Submission #1501067
Source Code Expand
#include<iostream> #include<vector> #include<queue> using namespace std; int main(){ int h,w; cin>>h>>w; vector<string> a(h); for(int i=0;i<h;i++){ cin>>a[i]; } int cnt=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++)if(a[i][j]=='#')cnt++; } queue<int> x; queue<int> y; x.push(0); y.push(0); while(x.empty()!=1){ int nx=x.front(); int ny=y.front(); //cout<<nx<<" "<<ny<<endl; x.pop(); y.pop(); if(nx==w-1&&ny==h-1&&cnt==w+h-1){ cout<<"Possible"<<endl; return 0; } //cout<<a[ny][nx+1]<<" "<<a[ny+1][nx]<<endl; if(a[ny][nx+1]=='#'){ x.push(nx+1); y.push(ny); } if(a[ny+1][nx]=='#'){ x.push(nx); y.push(ny+1); } } cout<<"Impossible"<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | shichinomiya |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 814 Byte |
Status | RE |
Exec Time | 97 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 | 97 ms | 256 KB |
001.txt | RE | 97 ms | 256 KB |
002.txt | RE | 96 ms | 256 KB |
003.txt | RE | 96 ms | 256 KB |
004.txt | RE | 97 ms | 256 KB |
005.txt | RE | 96 ms | 256 KB |
006.txt | RE | 96 ms | 256 KB |
007.txt | RE | 96 ms | 256 KB |
008.txt | RE | 96 ms | 256 KB |
009.txt | RE | 96 ms | 256 KB |
010.txt | AC | 1 ms | 256 KB |
011.txt | RE | 97 ms | 256 KB |
012.txt | AC | 1 ms | 256 KB |
013.txt | RE | 96 ms | 256 KB |
014.txt | RE | 96 ms | 256 KB |
015.txt | AC | 1 ms | 256 KB |
016.txt | RE | 96 ms | 256 KB |
017.txt | AC | 1 ms | 256 KB |
018.txt | RE | 96 ms | 256 KB |
example0.txt | RE | 96 ms | 256 KB |
example1.txt | AC | 1 ms | 256 KB |
example2.txt | RE | 96 ms | 256 KB |