結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-02 00:17:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 832 bytes |
| コンパイル時間 | 1,694 ms |
| コンパイル使用メモリ | 159,704 KB |
| 実行使用メモリ | 11,936 KB |
| 最終ジャッジ日時 | 2024-06-23 05:54:27 |
| 合計ジャッジ時間 | 12,015 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 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);
unsigned char A[2000010];
int main(){
ll N,S,X,Y,Z,Q;
cin >> N >> S >> X >> Y >> Z;
ll k = S;
A[0] = k % 2;
REP(i,N-1) A[i+1] = (k = (k*X+Y) % Z) % 2;
cin >> Q;
REP(i,Q){
int s,t,u,v;
cin >> s >> t >> u >> v;
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];
}
}
string res;
REP(i,N) res += A[i]?"O":"E";
cout << res << endl;
return 0;
}