結果
問題 | No.142 単なる配列の操作に関する実装問題 |
ユーザー | testestest |
提出日時 | 2015-12-13 18:39:28 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2,508 ms / 5,000 ms |
コード長 | 524 bytes |
コンパイル時間 | 405 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 11:46:31 |
合計ジャッジ時間 | 9,200 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 416 ms
5,248 KB |
testcase_01 | AC | 1,966 ms
5,376 KB |
testcase_02 | AC | 2,508 ms
5,376 KB |
testcase_03 | AC | 404 ms
5,376 KB |
testcase_04 | AC | 1,967 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",&n,&s,&x,&y,&z); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | unsigned a[70000],temp[4000]; main.c:6:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 6 | scanf("%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:29:18: warning: implicit declaration of function ‘putchar’ [-Wimplicit-function-declaration] 29 | for(i=1;i<=n;i++)putchar((a[i>>5]>>(i&31))&1?'O':'E');
ソースコード
unsigned a[70000],temp[4000]; n,p,s,x,y,z,i,j; long t; main(){ scanf("%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>>5]|=(t&1)<<(i&31); } scanf("%*d"); for(;~scanf("%d%d%d%*d",&s,&x,&y);){ x-=s-1; p=s&31;z=32-p; for(i=0,j=s>>5;i<<5<x;i++,j++){temp[i]=a[j]>>p;p?temp[i]|=a[j+1]<<z:0;} z=32-(x&31); temp[i-1]=temp[i-1]<<z>>z; p=y&31;z=32-p; for(i=0,j=y>>5;i<<5<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>>5]>>(i&31))&1?'O':'E'); return 0; }