結果

問題 No.2879 Range Flip Queries
ユーザー karinohitokarinohito
提出日時 2024-09-08 13:00:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 450 ms / 2,000 ms
コード長 472 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 203,420 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-09-08 13:00:17
合計ジャッジ時間 14,219 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 148 ms
6,944 KB
testcase_04 AC 148 ms
6,940 KB
testcase_05 AC 149 ms
6,940 KB
testcase_06 AC 151 ms
6,944 KB
testcase_07 AC 150 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 3 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 340 ms
6,940 KB
testcase_14 AC 356 ms
6,940 KB
testcase_15 AC 250 ms
6,940 KB
testcase_16 AC 100 ms
6,944 KB
testcase_17 AC 248 ms
6,944 KB
testcase_18 AC 435 ms
7,040 KB
testcase_19 AC 447 ms
7,040 KB
testcase_20 AC 442 ms
7,040 KB
testcase_21 AC 442 ms
7,168 KB
testcase_22 AC 445 ms
7,168 KB
testcase_23 AC 431 ms
7,040 KB
testcase_24 AC 440 ms
7,168 KB
testcase_25 AC 440 ms
7,168 KB
testcase_26 AC 450 ms
7,168 KB
testcase_27 AC 447 ms
7,168 KB
testcase_28 AC 443 ms
7,168 KB
testcase_29 AC 347 ms
7,168 KB
testcase_30 AC 347 ms
7,168 KB
testcase_31 AC 345 ms
7,168 KB
testcase_32 AC 347 ms
7,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/maxflow>
using namespace atcoder;
using namespace std;
using ll=long long;

int main(){
    int N,Q;
    cin>>N>>Q;
    vector<int> A(N);
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    vector<int> D(N);
    for(int i=0;i<Q;i++){
        int L,R;
        cin>>L>>R;
        L--;
        D[L]++;
        if(R<N)D[R]++;
    }
    for(int i=1;i<N;i++)D[i]+=D[i-1];
    for(int i=0;i<N;i++)cout<<(A[i]+D[i])%2<<" \n"[i==N-1];
}
0