結果
| 問題 | No.142 単なる配列の操作に関する実装問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-01 23:51:35 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 784 bytes |
| 記録 | |
| コンパイル時間 | 846 ms |
| コンパイル使用メモリ | 181,292 KB |
| 実行使用メモリ | 23,048 KB |
| 最終ジャッジ日時 | 2026-03-07 20:48:11 |
| 合計ジャッジ時間 | 25,374 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 2 TLE * 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;
}