Submission #979068
Source Code Expand
#include <iostream> #include <iomanip> #include <math.h> #include <map> #include <list> #include <set> #include <vector> #include <stack> #include <queue> #include <algorithm> #include <string> #include <sstream> #include <string.h> // #include <limits.h> #define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define FORUL(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) #define FORULE(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define FOREACH(it, X) for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++) #if defined(_MSC_VER) || __cplusplus > 199711L #define AUTOVAR(newvar,v) auto newvar = (v) #else #define AUTOVAR(newvar,v) __typeof(newvar) r = (v) #endif #define PB(x) push_back(x) #define MP(x,y) make_pair((x),(y)) #define MEMSET(m,v) memset(m,v,sizeof(m)) typedef long long ll; typedef unsigned long long ull; #define INTMAX 99999999 #define DEBUG 1 #if DEBUG #define DOUT cout<<"["<<__LINE__<<"]:" #else #define DOUT 0 && cout #endif using namespace std; int H,W; #define MAX_HW 8 string A[MAX_HW]; int main(int argc, char *argv[]) { ios::sync_with_stdio(false); cin >> H >> W; FOR(h,H) { cin >> A[h]; } int h=0; int w=0; bool result = true; while(h!=H-1 || w!=W-1) { A[h][w] = '*'; if(h>0) { if(A[h-1][w]=='#') { result = false; break; } } if(w>0) { if(A[h][w-1]=='#') { result = false; break; } } if(h<H) { if(A[h+1][w]=='#') { h=h+1; continue; } } if(w<W) { if(A[h][w+1]=='#') { w=w+1; continue; } } result = false; break; } if(result) { cout << "Possible"<<endl; } else { cout << "Impossible"<<endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | creatorstree |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1763 Byte |
Status | WA |
Exec Time | 234 ms |
Memory | 256 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 | RE | 234 ms | 256 KB |
001.txt | AC | 3 ms | 256 KB |
002.txt | AC | 2 ms | 256 KB |
003.txt | WA | 2 ms | 256 KB |
004.txt | WA | 2 ms | 256 KB |
005.txt | RE | 110 ms | 256 KB |
006.txt | AC | 2 ms | 256 KB |
007.txt | WA | 2 ms | 256 KB |
008.txt | AC | 2 ms | 256 KB |
009.txt | AC | 2 ms | 256 KB |
010.txt | AC | 2 ms | 256 KB |
011.txt | AC | 2 ms | 256 KB |
012.txt | AC | 2 ms | 256 KB |
013.txt | AC | 3 ms | 256 KB |
014.txt | RE | 110 ms | 256 KB |
015.txt | AC | 2 ms | 256 KB |
016.txt | RE | 109 ms | 256 KB |
017.txt | AC | 2 ms | 256 KB |
018.txt | AC | 2 ms | 256 KB |
example0.txt | AC | 2 ms | 256 KB |
example1.txt | AC | 2 ms | 256 KB |
example2.txt | AC | 2 ms | 256 KB |