結果

問題 No.142 単なる配列の操作に関する実装問題
コンテスト
ユーザー testestest
提出日時 2015-12-14 02:33:11
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 394 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 291 ms
コンパイル使用メモリ 30,532 KB
最終ジャッジ日時 2026-02-23 20:03:35
ジャッジサーバーID
(参考情報)
judge3 / 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: In function ‘main’:
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: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: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*x+y)%z)a[i/m]|=t%2<<i%m;
      |              ~^              ~~
      |               |              |
      |               int *          long unsigned int *
      |              %ld

ソースコード

diff #
raw source code

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