結果

問題 No.424 立体迷路
コンテスト
ユーザー 👑 tails
提出日時 2016-10-04 17:42:08
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 300 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 118 ms
コンパイル使用メモリ 29,892 KB
最終ジャッジ日時 2026-02-23 22:29:10
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | a;b;char*r="NO",m[120][60];f(x,y){m[y+60][x]++||(r=x-a|y-b?r:"YES"A(-1,0)A(1,0)A(0,-1)A(0,1));}main(i,x,y){for(scanf("%*d%*d%d%d%d%d ",&x,&y,&a,&b);gets(m[i++]+1););f(x,y);a=!puts(r);}
      | ^
main.c:2:3: warning: data definition has no type or storage class
    2 | a;b;char*r="NO",m[120][60];f(x,y){m[y+60][x]++||(r=x-a|y-b?r:"YES"A(-1,0)A(1,0)A(0,-1)A(0,1));}main(i,x,y){for(scanf("%*d%*d%d%d%d%d ",&x,&y,&a,&b);gets(m[i++]+1););f(x,y);a=!puts(r);}
      |   ^
main.c: In function ‘main’:
main.c:2:112: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    2 | a;b;char*r="NO",m[120][60];f(x,y){m[y+60][x]++||(r=x-a|y-b?r:"YES"A(-1,0)A(1,0)A(0,-1)A(0,1));}main(i,x,y){for(scanf("%*d%*d%d%d%d%d ",&x,&y,&a,&b);gets(m[i++]+1););f(x,y);a=!puts(r);}
      |                                                                                                                ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | #define A(u,v),abs(m[x][y]-m[x+u][y+v])<2&&f(x+u,y+v),m[x][y]==m[x+u*2][y+v*2]&&m[x][y]>m[x+u][y+v]&&f(x+u*2,y+v*2)
/usr/bin/ld: /tmp/ccala4Mx.o: in function `main':
main.c:(.text.startup+0x62): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #
raw source code

#define A(u,v),abs(m[x][y]-m[x+u][y+v])<2&&f(x+u,y+v),m[x][y]==m[x+u*2][y+v*2]&&m[x][y]>m[x+u][y+v]&&f(x+u*2,y+v*2)
a;b;char*r="NO",m[120][60];f(x,y){m[y+60][x]++||(r=x-a|y-b?r:"YES"A(-1,0)A(1,0)A(0,-1)A(0,1));}main(i,x,y){for(scanf("%*d%*d%d%d%d%d ",&x,&y,&a,&b);gets(m[i++]+1););f(x,y);a=!puts(r);}
0