結果
問題 | No.142 単なる配列の操作に関する実装問題 |
ユーザー |
👑 ![]() |
提出日時 | 2015-12-14 02:29:21 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 122 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 12:05:38 |
合計ジャッジ時間 | 4,702 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 5 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int] main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘z’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:9: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^ main.c:2:16: warning: return type defaults to ‘int’ [-Wimplicit-int] 2 | x,y,z,i,j,m=64;main(n){ | ^~~~ main.c: In function ‘main’: main.c:2:16: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:3:5: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 3 | for(scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);++i<=n;t=(t*x+y)%z)a[i/m]|=t%2<<i%m; | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | unsigned long a[32000],b[1600],t; main.c:3:5: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 3 | for(scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);++i<=n;t=(t*x+y)%z)a[i/m]|=t%2<<i%m; | ^~~~~ main.c:3:5: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:3:15: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long unsigned int *’ [-Wformat=] 3 | for(scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);++i<=n;t=(t
ソースコード
unsigned long a[32000],b[1600],t; x,y,z,i,j,m=64;main(n){ for(scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);++i<=n;t=(t*x+y)%z)a[i/m]|=t%2<<i%m; for(;~scanf("%d%d%d%*d",&z,&x,&y);){ x-=z-1;t=z%m; for(i=0,j=z/m;i*64<x;b[i++]=a[j++]>>t)t?b[i]|=a[j+1]<<64-t:0; z=m-x%m;b[i-1]=b[i-1]<<z>>z;t=y%64; for(i=0,j=y/m;i*64<x;a[j++]^=b[i++]<<t)t?a[j+1]^=b[i]>>64-t:0; } for(i=0;++i<=n;)putchar(a[i/m]>>i%m&1?79:69); }