結果
問題 | No.142 単なる配列の操作に関する実装問題 |
ユーザー | 👑 testestest |
提出日時 | 2015-12-13 18:58:21 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 1,166 ms / 5,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 565 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 11:47:51 |
合計ジャッジ時間 | 5,589 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 270 ms
5,248 KB |
testcase_01 | AC | 935 ms
5,376 KB |
testcase_02 | AC | 1,166 ms
5,376 KB |
testcase_03 | AC | 261 ms
5,376 KB |
testcase_04 | AC | 924 ms
5,376 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:9: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘z’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:13: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:2:15: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 2 | n,p,s,x,y,z,i,j; | ^ main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 5 | main(){ | ^~~~ main.c: In function ‘main’: main.c:6:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 6 | scanf("%d%d%d%d%d%*d",&n,&s,&x,&y,&z); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | unsigned long a[32000],temp[1600]; main.c:6:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 6 | scanf("%d%d%d%d%d%*d",&n,&s,&x,&y,&z); | ^~~~~ main.c:6:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:27:18: warning: implicit declaration of function ‘putchar’ [-Wimplicit-function-declaration] 27 | for(i=1;i<=n;i++)putchar((a[i>>6]>>(i&63))&1?
ソースコード
unsigned long a[32000],temp[1600]; n,p,s,x,y,z,i,j; long t; main(){ scanf("%d%d%d%d%d%*d",&n,&s,&x,&y,&z); a[0]=s&1<<1;t=s; for(i=2;i<=n;i++){ t=(t*x+y)%z; a[i>>6]|=(t&1)<<(i&63); } for(;~scanf("%d%d%d%*d",&s,&x,&y);){ x-=s-1; p=s&63;z=64-p; for(i=0,j=s>>6;i<<6<x;i++,j++){temp[i]=a[j]>>p;p?temp[i]|=a[j+1]<<z:0;} z=64-(x&63); temp[i-1]=temp[i-1]<<z>>z; p=y&63;z=64-p; for(i=0,j=y>>6;i<<6<x;i++,j++){a[j]^=temp[i]<<p;p?a[j+1]^=temp[i]>>z:0;} } for(i=1;i<=n;i++)putchar((a[i>>6]>>(i&63))&1?'O':'E'); return 0; }