結果
| 問題 |
No.142 単なる配列の操作に関する実装問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-02 00:16:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 869 bytes |
| コンパイル時間 | 607 ms |
| コンパイル使用メモリ | 64,220 KB |
| 実行使用メモリ | 19,516 KB |
| 最終ジャッジ日時 | 2024-06-23 05:52:55 |
| 合計ジャッジ時間 | 15,035 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 -- * 3 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
template <class T>
void show(T &a, string sep = " ") {
for (auto it = a.begin(); it != a.end(); it++) {
cout << *it << sep;
}
cout << endl;
}
int main() {
long long n, s, x, y, z, q;
cin >> n >> s >> x >> y >> z;
vector<long long> a(n, 0);
a[0] = s;
for (int i = 0; i < n; i++) {
a[i + 1] = (x * a[i] + y) % z;
}
// show(a);
cin >> q;
long long ss, tt, uu, vv;
for (int i = 0; i < q; i++) {
cin >> ss >> tt >> uu >> vv;
vector<int> b(a.begin() + ss - 1, a.begin() + tt);
// show(b);
// printf("%d %lld %d\n", b.size(), vv - uu, b[0]);
for (int j = uu - 1; j <= vv - 1; j++) {
a[j] += b[j - uu + 1];
}
// show(a);
}
for (int i = 0; i < n; i++) {
cout << (a[i] % 2 ? "O" : "E");
}
cout << endl;
return 0;
}