結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-01 23:51:35 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 784 bytes |
| コンパイル時間 | 1,582 ms |
| コンパイル使用メモリ | 158,828 KB |
| 実行使用メモリ | 17,964 KB |
| 最終ジャッジ日時 | 2024-06-23 05:36:44 |
| 合計ジャッジ時間 | 11,799 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 TLE * 1 -- * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define REP(i, n) for(int(i)=0;(i)<(n);++(i))
#define FOR(i, f, t) for(int(i)=(f);(i)<(t);(++i))
#define RREP(i, n) for(int(i)=(n)-1;(i)>=0;--(i))
const int MOD = int(1e9+7);
int A[2000010];
int main(){
int N,S,X,Y,Z,Q;
cin >> N >> S >> X >> Y >> Z;
A[1] = S;
FOR(i,1,N) A[i+1] = (A[i]*X+Y) % Z;
FOR(i,1,N+1) A[i] %= 2;
cin >> Q;
REP(i,Q){
int s,t,u,v;
cin >> s >> t >> u >> v;
if(s < u){
RREP(j,t-s+1) A[u+j] ^= A[s+j];
} else {
REP(j,t-s+1) A[u+j] ^= A[s+j];
}
}
FOR(i,1,N+1) cout << (A[i]?"O":"E");
cout << endl;
return 0;
}