Submission #2469239
Source Code Expand
#include <stdio.h> #include <math.h> int main() { int H, W; scanf("%d %d", &H, &W); char masu[H+2][W+2]; int i, j; for (i=0;i<=H+1;i++){ for (j=0;j<=W+1;j++){ masu[i][j] = '.'; } } for (i=1;i<=H;i++){ for (j=1;j<=W;j++){ scanf("%c", &masu[i][j]); } } for (i=0;i<=H+1;i++){ masu[i][W+1] = '.'; } int canyou = 1; for (i=1;i<=H;i++){ for (j=1;j<=W;j++){ if (masu[i][j]=='#'){ if (((masu[i-1][j]=='#')||(masu[i+1][j]=='#'))||((masu[i][j-1]=='#')||(masu[i][j+1]=='#'))){ canyou = 1; } else { canyou = 0; } } } } if (canyou == 1) printf("Yes"); else printf("No"); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Grid Repainting 2 |
User | Haruyuk1 |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 871 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 128 KB |
Compile Error
./Main.c: In function ‘main’: ./Main.c:7:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d", &H, &W); ^ ./Main.c:17:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%c", &masu[i][j]); ^
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 | AC | 1 ms | 128 KB |
in02.txt | AC | 1 ms | 128 KB |
in03.txt | AC | 1 ms | 128 KB |
in04.txt | AC | 1 ms | 128 KB |
in05.txt | WA | 1 ms | 128 KB |
in06.txt | AC | 1 ms | 128 KB |
in07.txt | WA | 1 ms | 128 KB |
in08.txt | AC | 1 ms | 128 KB |
in09.txt | WA | 1 ms | 128 KB |
in10.txt | AC | 1 ms | 128 KB |
sample_01.txt | AC | 1 ms | 128 KB |
sample_02.txt | WA | 1 ms | 128 KB |
sample_03.txt | AC | 1 ms | 128 KB |