結果

問題 No.142 単なる配列の操作に関する実装問題
ユーザー 👑 testestesttestestest
提出日時 2015-12-14 02:33:11
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-09-15 12:06:39
合計ジャッジ時間 6,485 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

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*m<x;b[i++]|=a[j++]>>t)t?b[i]=a[j+1]<<m-t:0;
z=m-x%m;b[i-1]=b[i-1]<<z>>z;t=y%m;
for(i=0,j=y/m;i*m<x;a[j++]^=b[i++]<<t)t?a[j+1]^=b[i]>>m-t:0;
}
for(i=0;++i<=n;)putchar(a[i/m]>>i%m&1?79:69);
}
0