結果
問題 | No.697 池の数はいくつか |
ユーザー | tails |
提出日時 | 2018-06-09 18:13:36 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 885 ms / 6,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 439 ms |
コンパイル使用メモリ | 29,568 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-08 07:36:15 |
合計ジャッジ時間 | 8,060 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,248 KB |
testcase_04 | AC | 1 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 1 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 1 ms
5,248 KB |
testcase_09 | AC | 1 ms
5,248 KB |
testcase_10 | AC | 1 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | AC | 1 ms
5,248 KB |
testcase_13 | AC | 1 ms
5,248 KB |
testcase_14 | AC | 1 ms
5,248 KB |
testcase_15 | AC | 1 ms
5,248 KB |
testcase_16 | AC | 1 ms
5,248 KB |
testcase_17 | AC | 1 ms
5,248 KB |
testcase_18 | AC | 1 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 1 ms
5,248 KB |
testcase_22 | AC | 1 ms
5,248 KB |
testcase_23 | AC | 1 ms
5,248 KB |
testcase_24 | AC | 101 ms
5,248 KB |
testcase_25 | AC | 98 ms
5,248 KB |
testcase_26 | AC | 98 ms
5,248 KB |
testcase_27 | AC | 100 ms
5,248 KB |
testcase_28 | AC | 99 ms
5,248 KB |
testcase_29 | AC | 745 ms
10,880 KB |
testcase_30 | AC | 878 ms
10,496 KB |
testcase_31 | AC | 750 ms
10,880 KB |
testcase_32 | AC | 885 ms
10,624 KB |
testcase_33 | AC | 882 ms
10,624 KB |
testcase_34 | AC | 877 ms
10,624 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | h,w;r; | ^ main.c:2:1: warning: type defaults to 'int' in declaration of 'h' [-Wimplicit-int] main.c:2:3: warning: type defaults to 'int' in declaration of 'w' [-Wimplicit-int] 2 | h,w;r; | ^ main.c:2:5: warning: data definition has no type or storage class 2 | h,w;r; | ^ main.c:2:5: warning: type defaults to 'int' in declaration of 'r' [-Wimplicit-int] main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int] 3 | f(y,x,l,r){ | ^ main.c: In function 'f': main.c:3:1: warning: type of 'y' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'x' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'l' defaults to 'int' [-Wimplicit-int] main.c:3:1: warning: type of 'r' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:12:1: warning: return type defaults to 'int' [-Wimplicit-int] 12 | main(y,x){ | ^~~~ main.c: In function 'main': main.c:12:1: warning: type of 'y' defaults to 'int' [-Wimplicit-int] main.c:12:1: warning: type of 'x' defaults to 'int' [-Wimplicit-int] main.c:13:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 13 | scanf("%d%d",&h,&w); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | char a[3010][3010]; main.c:13:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 13 | scanf("%d%d",&h,&w); | ^~~~~ main.c:13:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:27:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 27 | printf("%d",r); | ^~~~~~ main.c:27:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:27:9: warning: incompatible implicit declaration of built-in function 'printf' [-
ソースコード
char a[3010][3010]; h,w;r; f(y,x,l,r){ l=r=x; while(a[y][l-1])a[y][--l]=0; while(a[y][r])a[y][r++]=0; for(x=l;x<r;++x){ if(a[y-1][x])f(y-1,x); if(a[y+1][x])f(y+1,x); } } main(y,x){ scanf("%d%d",&h,&w); for(y=1;y<=h;++y){ for(x=1;x<=w;++x){ scanf("%d",&a[y][x]); } } for(y=1;y<=h;++y){ for(x=1;x<=w;++x){ if(a[y][x]){ ++r; f(y,x); } } } printf("%d",r); }