結果
問題 |
No.585 工夫のないパズル
|
ユーザー |
![]() |
提出日時 | 2017-11-03 10:49:24 |
言語 | C (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 905 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 31,488 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-22 15:19:34 |
合計ジャッジ時間 | 5,017 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | RE * 12 |
コンパイルメッセージ
main.c:3:1: warning: data definition has no type or storage class 3 | p[100],N; | ^ main.c:3:1: warning: type defaults to 'int' in declaration of 'p' [-Wimplicit-int] main.c:3:8: warning: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] 3 | p[100],N; | ^ main.c:5:1: warning: return type defaults to 'int' [-Wimplicit-int] 5 | idx(n){ | ^~~ main.c: In function 'idx': main.c:5:1: warning: type of 'n' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:11:1: warning: return type defaults to 'int' [-Wimplicit-int] 11 | yoko(r,a){ | ^~~~ main.c: In function 'yoko': main.c:11:1: warning: type of 'r' defaults to 'int' [-Wimplicit-int] main.c:11:1: warning: type of 'a' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:19:1: warning: return type defaults to 'int' [-Wimplicit-int] 19 | tate(c,b){ | ^~~~ main.c: In function 'tate': main.c:19:1: warning: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:19:1: warning: type of 'b' defaults to 'int' [-Wimplicit-int] main.c: At top level: main.c:27:1: warning: return type defaults to 'int' [-Wimplicit-int] 27 | main(i,j){ | ^~~~ main.c: In function 'main': main.c:27:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:27:1: warning: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:28:29: warning: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 28 | for(i=0;i<16;++i&3||getchar()){ | ^~~~~~~ main.c:1:1: note: 'getchar' is defined in header '<stdio.h>'; did you forget to '#include <stdio.h>'? +++ |+#include <stdio.h> 1 | typedef unsigned long long ull; main.c:55:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 55 | printf("%d\n",N); | ^~~~~~ main.c:55:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:55:9: warning: incompatible implicit declaration
ソースコード
typedef unsigned long long ull; ull z; p[100],N; idx(n){ int r,i; for(i=0;i<16;++i)(z>>4*i&15)==n?r=15-i:0; return r; } yoko(r,a){ ull m=0xffff000000000000ull>>16*(r&=3); if(a&=3){ z=~m&z|m&z>>4*a|m&z<<4*(4-a); p[N++]=0<<4|r<<2|a; } } tate(c,b){ ull m=0xf000f000f000f000ull>>4*(c&=3); if(b&=3){ z=~m&z|m&z>>16*b|m&z<<16*(4-b); p[N++]=1<<4|c<<2|b; } } main(i,j){ for(i=0;i<16;++i&3||getchar()){ z=z<<4|getchar()-1&15; } for(i=0;i<15;++i){ for(;i!=(j=idx(i));){ if(i<12){ if((i&3)==(j&3)){ yoko(j>>2,1); j=j&12|j+1&3; } tate(j,3-(j>>2)); tate(i,3-(i>>2)); yoko(3,i-j); tate(i,(i>>2)-3); tate(j,(j>>2)-3); }else{ tate(j,3); yoko(3,2); tate(j,1); yoko(3,1); tate(j,3); yoko(3,1); tate(j,1); yoko(3,1); } } } printf("%d\n",N); for(i=0;i<N;++i)printf("%c %d %d\n","RC"[p[i]>>4],p[i]>>2&3,p[i]&3); }