結果

問題 No.142 単なる配列の操作に関する実装問題
ユーザー なおなお
提出日時 2015-02-01 23:51:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 1,122 ms
コンパイル使用メモリ 144,992 KB
実行使用メモリ 15,644 KB
最終ジャッジ日時 2023-09-05 09:45:24
合計ジャッジ時間 11,955 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0