結果

問題 No.424 立体迷路
ユーザー testestesttestestest
提出日時 2017-02-08 07:09:35
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 07:13:24
合計ジャッジ時間 833 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 0 ms
5,376 KB
testcase_07 AC 0 ms
5,376 KB
testcase_08 AC 0 ms
5,376 KB
testcase_09 AC 0 ms
5,376 KB
testcase_10 AC 0 ms
5,376 KB
testcase_11 AC 0 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 0 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 0 ms
5,376 KB
testcase_17 AC 0 ms
5,376 KB
testcase_18 AC 0 ms
5,376 KB
testcase_19 AC 0 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 0 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 0 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | a,b,x,y;
      | ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
    2 | a,b,x,y;
      |   ^
main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
    2 | a,b,x,y;
      |     ^
main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int]
    2 | a,b,x,y;
      |       ^
main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    3 | f(p,q){
      | ^
main.c: In function ‘f’:
main.c:3:1: warning: type of ‘p’ defaults to ‘int’ [-Wimplicit-int]
main.c:3:1: warning: type of ‘q’ defaults to ‘int’ [-Wimplicit-int]
main.c:5:17: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
    5 |                 abs(s[p-1][q]-s[p][q])<2&&f(p-1,q);
      |                 ^~~
main.c:1:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
  +++ |+#include <stdlib.h>
    1 | char s[199][99];
main.c: At top level:
main.c:15:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
   15 | main(i){
      | ^~~~
main.c: In function ‘main’:
main.c:15:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:16:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
   16 |         scanf("%*d%*d%d%d%d%d ",&a,&b,&x,&y);
      |         ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | char s[199][99];
main.c:16:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
   16 |         scanf("%*d%*d%d%d%d%d ",&a,&b,&x,&y);
      |         ^~~~~
main.c:16:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:17:14: warning: i

ソースコード

diff #

char s[199][99];
a,b,x,y;
f(p,q){
	if(!s[p+98][q]++){
		abs(s[p-1][q]-s[p][q])<2&&f(p-1,q);
		abs(s[p+1][q]-s[p][q])<2&&f(p+1,q);
		abs(s[p][q-1]-s[p][q])<2&&f(p,q-1);
		abs(s[p][q+1]-s[p][q])<2&&f(p,q+1);
		s[p-2][q]==s[p][q]&&s[p][q]>s[p-1][q]&&f(p-2,q);
		s[p+2][q]==s[p][q]&&s[p][q]>s[p+1][q]&&f(p+2,q);
		s[p][q-2]==s[p][q]&&s[p][q]>s[p][q-1]&&f(p,q-2);
		s[p][q+2]==s[p][q]&&s[p][q]>s[p][q+1]&&f(p,q+2);
	}
}
main(i){
	scanf("%*d%*d%d%d%d%d ",&a,&b,&x,&y);
	for(;gets(s[++i]+2););
	f(a+1,b+1);
	a=!puts(s[x+99][y+1]?"YES":"NO");
}
0