結果

問題 No.142 単なる配列の操作に関する実装問題
ユーザー 👑 testestesttestestest
提出日時 2015-12-14 02:38:17
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1,343 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 450 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 12:07:01
合計ジャッジ時間 5,643 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
5,248 KB
testcase_01 AC 1,064 ms
5,376 KB
testcase_02 AC 1,343 ms
5,376 KB
testcase_03 AC 277 ms
5,376 KB
testcase_04 AC 1,053 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class
    2 | s,x,y,z,i,j,m=64;main(n){
      | ^
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |   ^
main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |     ^
main.c:2:7: warning: type defaults to ‘int’ in declaration of ‘z’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |       ^
main.c:2:9: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |         ^
main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |           ^
main.c:2:13: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |             ^
main.c:2:18: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | s,x,y,z,i,j,m=64;main(n){
      |                  ^~~~
main.c: In function ‘main’:
main.c:2:18: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int]
main.c:3:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    3 | scanf("%d%d%d%d%d%*d",&n,&t,&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],b[1600],t;
main.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    3 | scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);
      | ^~~~~
main.c:3:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:3:11: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long unsigned int *�

ソースコード

diff #

unsigned long a[32000],b[1600],t;
s,x,y,z,i,j,m=64;main(n){
scanf("%d%d%d%d%d%*d",&n,&t,&x,&y,&z);
for(;++i<=n;t=(t*x+y)%z)a[i/m]|=t%2<<i%m;
for(;~scanf("%d%d%d%*d",&s,&x,&y);){
x-=s-1;t=s%m;
for(i=0,j=s/m;i*m<x;i++,j++){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;i++,j++){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