結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-03-16 09:40:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 597 bytes |
| コンパイル時間 | 1,782 ms |
| コンパイル使用メモリ | 172,492 KB |
| 実行使用メモリ | 26,144 KB |
| 最終ジャッジ日時 | 2024-11-07 20:38:35 |
| 合計ジャッジ時間 | 15,483 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
long N,S,X,Y,Z;
cin>>N>>S>>X>>Y>>Z;
long temp;
vector<long> A(N);
int Q;
cin>>Q;
temp=S;
for(int i=0;i<N;i++){
A[i]=temp%2;
temp=(temp*X+Y)%Z;
}
int s,t,u,v;
queue<int> q;
for(int i=0;i<Q;i++){
cin>>s>>t>>u>>v;
for(int k=s-1;k<=t-1;k++){
q.push(A[k]);
}
for(int k=u-1;k<=v-1;k++){
A[k]=A[k]^q.front();
q.pop();
}
}
for(int i=0;i<N;i++){
cout<<(A[i]?'O':'E');
}
cout<<endl;
}
ytft