結果

問題 No.142 単なる配列の操作に関する実装問題
ユーザー cielciel
提出日時 2015-05-27 22:11:18
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 3,987 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 25,048 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 16:46:09
合計ジャッジ時間 13,462 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 557 ms
4,380 KB
testcase_01 AC 3,077 ms
4,376 KB
testcase_02 AC 3,987 ms
4,380 KB
testcase_03 AC 538 ms
4,380 KB
testcase_04 AC 3,081 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:53: warning: data definition has no type or storage class
 typedef unsigned long long ull;ull A[32000],B[9999];i=-1,N,S,T,U,L,w=64;main(Q){scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&L,&Q);for(;++i<N;S=((ull)T*S+U)%L)A[i/w]|=(ull)S%2<<i%w;for(;~scanf("%d%d%d%d",&S,&T,&U,&L);){for(T-=--S,--U,L=(T+63)/w,i=-1;++i<L;S%w&&(B[i]|=A[S/w+i+1]<<w-S%w))B[i]=A[S/w+i]>>S%w;for((T%=w)&&(B[L-1]=B[L-1]<<w-T>>w-T);L--;U%w&&(A[U/w+L+1]^=B[L]>>w-U%w))A[U/w+L]^=B[L]<<U%w;}for(i=-1;++i<N;)putchar(A[i/w]>>i%w&1?79:69);}
                                                     ^
main.c:1:53: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
main.c:1:58: warning: type defaults to ‘int’ in declaration of ‘N’ [-Wimplicit-int]
 typedef unsigned long long ull;ull A[32000],B[9999];i=-1,N,S,T,U,L,w=64;main(Q){scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&L,&Q);for(;++i<N;S=((ull)T*S+U)%L)A[i/w]|=(ull)S%2<<i%w;for(;~scanf("%d%d%d%d",&S,&T,&U,&L);){for(T-=--S,--U,L=(T+63)/w,i=-1;++i<L;S%w&&(B[i]|=A[S/w+i+1]<<w-S%w))B[i]=A[S/w+i]>>S%w;for((T%=w)&&(B[L-1]=B[L-1]<<w-T>>w-T);L--;U%w&&(A[U/w+L+1]^=B[L]>>w-U%w))A[U/w+L]^=B[L]<<U%w;}for(i=-1;++i<N;)putchar(A[i/w]>>i%w&1?79:69);}
                                                          ^
main.c:1:60: warning: type defaults to ‘int’ in declaration of ‘S’ [-Wimplicit-int]
 typedef unsigned long long ull;ull A[32000],B[9999];i=-1,N,S,T,U,L,w=64;main(Q){scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&L,&Q);for(;++i<N;S=((ull)T*S+U)%L)A[i/w]|=(ull)S%2<<i%w;for(;~scanf("%d%d%d%d",&S,&T,&U,&L);){for(T-=--S,--U,L=(T+63)/w,i=-1;++i<L;S%w&&(B[i]|=A[S/w+i+1]<<w-S%w))B[i]=A[S/w+i]>>S%w;for((T%=w)&&(B[L-1]=B[L-1]<<w-T>>w-T);L--;U%w&&(A[U/w+L+1]^=B[L]>>w-U%w))A[U/w+L]^=B[L]<<U%w;}for(i=-1;++i<N;)putchar(A[i/w]>>i%w&1?79:69);}
                                                            ^
main.c:1:62: warning: type defaults to ‘int’ in declaration of ‘T’ [-Wimplicit-int]
 typedef unsigned long long ull;ull A[32000],B[9999];i=-1,N,S,T,U,L,w=64;main

ソースコード

diff #

typedef unsigned long long ull;ull A[32000],B[9999];i=-1,N,S,T,U,L,w=64;main(Q){scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&L,&Q);for(;++i<N;S=((ull)T*S+U)%L)A[i/w]|=(ull)S%2<<i%w;for(;~scanf("%d%d%d%d",&S,&T,&U,&L);){for(T-=--S,--U,L=(T+63)/w,i=-1;++i<L;S%w&&(B[i]|=A[S/w+i+1]<<w-S%w))B[i]=A[S/w+i]>>S%w;for((T%=w)&&(B[L-1]=B[L-1]<<w-T>>w-T);L--;U%w&&(A[U/w+L+1]^=B[L]>>w-U%w))A[U/w+L]^=B[L]<<U%w;}for(i=-1;++i<N;)putchar(A[i/w]>>i%w&1?79:69);}
0