結果

問題 No.402 最も海から遠い場所
コンテスト
ユーザー %20
提出日時 2018-05-31 22:17:08
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 274 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 87 ms
コンパイル使用メモリ 25,940 KB
最終ジャッジ日時 2026-02-22 01:09:40
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | S[3002][3002],H,W,x,y,z;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:1:15: error: type defaults to 'int' in declaration of 'H' [-Wimplicit-int]
    1 | S[3002][3002],H,W,x,y,z;
      |               ^
main.c:1:17: error: type defaults to 'int' in declaration of 'W' [-Wimplicit-int]
    1 | S[3002][3002],H,W,x,y,z;
      |                 ^
main.c:1:19: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | S[3002][3002],H,W,x,y,z;
      |                   ^
main.c:1:21: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
    1 | S[3002][3002],H,W,x,y,z;
      |                     ^
main.c:1:23: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
    1 | S[3002][3002],H,W,x,y,z;
      |                       ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:3:9: error: 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;
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: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
    5 |                 S[y][x]=getchar()=='#'?1e9:0;
      |                         ^~~~~~~
main.c:5:25: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:8:19: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration]
    8 |                 z=fma

ソースコード

diff #
raw source code

S[3002][3002],H,W,x,y,z;
main(){
	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){
		z=fmax(z,S[y][x]=fmin(S[y][x],fmin(S[y-1][x-1],fmin(S[y-1][x],S[y][x-1]))+1));
	}
	printf("%d",-~z/2);
}
0