結果
問題 | No.402 最も海から遠い場所 |
ユーザー | %20 |
提出日時 | 2018-05-31 22:09:32 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 551 ms / 3,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 947 ms |
コンパイル使用メモリ | 30,208 KB |
実行使用メモリ | 36,992 KB |
最終ジャッジ日時 | 2024-06-30 08:41:52 |
合計ジャッジ時間 | 5,167 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 4 ms
5,376 KB |
testcase_14 | AC | 3 ms
5,376 KB |
testcase_15 | AC | 16 ms
5,376 KB |
testcase_16 | AC | 23 ms
5,632 KB |
testcase_17 | AC | 267 ms
23,808 KB |
testcase_18 | AC | 539 ms
36,992 KB |
testcase_19 | AC | 544 ms
36,864 KB |
testcase_20 | AC | 551 ms
36,992 KB |
testcase_21 | AC | 546 ms
36,976 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:1: warning: type defaults to 'int' in declaration of 'S' [-Wimplicit-int] main.c:1:15: warning: type defaults to 'int' in declaration of 'H' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:17: warning: type defaults to 'int' in declaration of 'W' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:19: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:21: warning: type defaults to 'int' in declaration of 'y' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:23: warning: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:1:25: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int] 1 | S[3002][3002],H,W,x,y,z,d; | ^ main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(t){ | ^~~~ main.c: In function 'main': main.c:2:1: warning: type of 't' defaults to 'int' [-Wimplicit-int] main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d%d ",&H,&W); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | S[3002][3002],H,W,x,y,z,d; main.c:3:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 3 | scanf("%d%d ",&H,&W); | ^~~~~ main.c:3:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:25: warning: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 5 | S[y][x]=getchar()=='#'?1e9:0; |
ソースコード
S[3002][3002],H,W,x,y,z,d; main(t){ scanf("%d%d ",&H,&W); for(y=1;y<=H;++y)for(x=1;x<=W+1;++x){ S[y][x]=getchar()=='#'?1e9:0; } for(y=1;y<=H;++y)for(x=1;x<=W;++x){ t=S[y][x-1]; for(d=-1;d<=1;++d){ t=fmin(t,S[y-1][x+d]); } S[y][x]=fmin(S[y][x],t+1); } for(y=H;y>0;--y)for(x=W;x>0;--x){ t=S[y][x+1]; for(d=-1;d<=1;++d){ t=fmin(t,S[y+1][x+d]); } z=fmax(z,S[y][x]=fmin(S[y][x],t+1)); } printf("%d",z); }