Submission #5920300
Source Code Expand
#include <stdio.h> int main() { int h, w; int i, j; char p[52][53]={NULL}; scanf("%d%d", &h, &w); for(i=0; i < h; i++){ scanf("%s", &p[i+1][1]); } for(i=1; i <= h; i++){ for(j=1; j <= w; j++){ if(p[i][j] == '#' && p[i-1][j] != '#' && p[i+1][j] == '#' && p[i][j-1] == '#' && p[i][j+1] == '#'){ break; } } } printf("%d\n", i); printf("%d\n", j); if(i == h+1 && j == w+1){ printf("Yes"); } else{ printf("No"); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Grid Repainting 2 |
User | chachazukin |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 494 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:7:18: warning: initialization makes integer from pointer without a cast [-Wint-conversion] char p[52][53]={NULL}; ^ ./Main.c:7:18: note: (near initialization for ‘p[0][0]’) ./Main.c:9:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d", &h, &w); ^ ./Main.c:12:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%s", &p[i+1][1]); ^
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | WA | 1 ms | 128 KB |
in02.txt | WA | 1 ms | 128 KB |
in03.txt | WA | 1 ms | 128 KB |
in04.txt | WA | 1 ms | 128 KB |
in05.txt | WA | 1 ms | 128 KB |
in06.txt | WA | 1 ms | 128 KB |
in07.txt | WA | 1 ms | 128 KB |
in08.txt | WA | 1 ms | 128 KB |
in09.txt | WA | 1 ms | 128 KB |
in10.txt | WA | 1 ms | 128 KB |
sample_01.txt | WA | 1 ms | 128 KB |
sample_02.txt | WA | 1 ms | 128 KB |
sample_03.txt | WA | 1 ms | 128 KB |