結果

問題 No.142 単なる配列の操作に関する実装問題
ユーザー cielciel
提出日時 2015-05-27 21:58:53
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,955 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 39,304 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 16:35:57
合計ジャッジ時間 7,422 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 318 ms
4,376 KB
testcase_01 AC 1,534 ms
4,376 KB
testcase_02 AC 1,955 ms
4,376 KB
testcase_03 AC 310 ms
4,380 KB
testcase_04 AC 1,527 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import<vector>
  ^~~~~~
main.cpp:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
 #import<cstdio>
  ^~~~~~

ソースコード

diff #

#import<vector>
#import<cstdio>
using namespace std;typedef unsigned long long ull;int main(){
int i=-1,N,S,T,U,L,Q,w=64;
scanf("%d%d%d%d%d%d",&N,&S,&T,&U,&L,&Q);
vector<ull>A(Q=(N+127)/w),B(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);putchar(10);}
0