Submission #979559


Source Code Expand

#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<stack> 
#include<queue>
#include<set>
#include<map>
#define LL long long
#define N 105
#define MOD 1000000007
#define FOR(i,l,r) for (int i = (l); i <= (r); i ++)
#define CLR(a,x) memset(a,x,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define INF 0x7fffffff
#define pb push_back
#define X first
#define Y second
#define eps 1e-6
using namespace std;
char mp[N][N];
int main(){
	int h,w;
	scanf("%d%d",&h,&w);
	FOR(i,1,h) {
		scanf("%s",mp[i] + 1);
		mp[i][w + 1] = '.';
	}
	FOR(i,1,w) mp[h + 1][i] = '.';
	int px = 1,py = 1,flag = 1;
	while (1){
		if (mp[px + 1][py] == '#' && mp[px][py + 1] == '#'){
			flag = 0;
			break;
		}
		else if (mp[px + 1][py] == '#') px ++;
		else if (mp[px][py + 1] == '#') py ++;
		else{
			flag = 0;
			break;
		}
		if (px == h && py == w) break;
	}
	if (flag) printf("Possible\n");
	else printf("Impossible\n");
}

Submission Info

Submission Time
Task A - Shik and Stone
User zzx
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1008 Byte
Status WA
Exec Time 2 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:26:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&h,&w);
                     ^
./Main.cpp:28:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s",mp[i] + 1);
                        ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 20
WA × 2
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 2 ms 256 KB
001.txt WA 2 ms 256 KB
002.txt AC 2 ms 256 KB
003.txt AC 2 ms 256 KB
004.txt WA 2 ms 256 KB
005.txt AC 2 ms 256 KB
006.txt AC 2 ms 256 KB
007.txt AC 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 2 ms 256 KB
014.txt AC 2 ms 256 KB
015.txt AC 2 ms 256 KB
016.txt AC 2 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