Submission #980053
Source Code Expand
#include <iostream> #include <string> #include <map> #include <vector> #include <set> #include <iomanip> #include <fstream> #include <stdint.h> #include <cmath> #include <algorithm> #include <utility> #include <numeric> using namespace std; constexpr int INF = 1000000000;/* 1e+9a */ constexpr int MODULO = 1000000007; #define REP(i,f,n) for(int i=(f); i < (n); ++i) #define PER(i,f,n) for(int i=(n-1); i >= f; --i) //---------------------------------- //---------------------------------- signed main() { ios::sync_with_stdio(false); int h,w; cin >> h >> w; vector<vector<char>> a; a.push_back(vector<char>(w+2, '.')); h++; REP(i, 1, h) { a.push_back(vector<char>()); a[i].push_back('.'); REP(j, 0, w) { char tmp; cin >> tmp; a[i].push_back(tmp); } a[i].push_back('.'); } a.push_back(vector<char>(w+2, '.')); h--; bool possible = true; int nx = 1; int ny = 1; while(true) { /* cerr << nx << ';' << ny << '\n'; */ if(nx == h && ny == w) break; else if(a[nx+1][ny] == '#') { if(a[nx][ny+1] == '#') { possible = false; break; } nx++; } else if(a[nx][ny+1] == '#') ny++; else { possible = false; break; } } cout << (possible ? "Possible\n" : "Impossible\n"); }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | xelmeph |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1343 Byte |
Status | WA |
Exec Time | 3 ms |
Memory | 384 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 3 ms | 256 KB |
001.txt | WA | 3 ms | 256 KB |
002.txt | AC | 3 ms | 256 KB |
003.txt | AC | 3 ms | 256 KB |
004.txt | WA | 3 ms | 384 KB |
005.txt | AC | 3 ms | 256 KB |
006.txt | AC | 3 ms | 256 KB |
007.txt | AC | 3 ms | 256 KB |
008.txt | AC | 3 ms | 256 KB |
009.txt | AC | 3 ms | 384 KB |
010.txt | AC | 3 ms | 256 KB |
011.txt | AC | 3 ms | 256 KB |
012.txt | AC | 3 ms | 256 KB |
013.txt | AC | 3 ms | 256 KB |
014.txt | AC | 3 ms | 256 KB |
015.txt | AC | 3 ms | 256 KB |
016.txt | AC | 3 ms | 256 KB |
017.txt | AC | 3 ms | 256 KB |
018.txt | AC | 3 ms | 256 KB |
example0.txt | AC | 3 ms | 256 KB |
example1.txt | AC | 3 ms | 256 KB |
example2.txt | AC | 3 ms | 256 KB |