結果

問題 No.2879 Range Flip Queries
ユーザー Iroha_3856Iroha_3856
提出日時 2024-07-26 15:29:09
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 556 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 33,408 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-09-08 12:00:37
合計ジャッジ時間 5,601 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 70 ms
6,944 KB
testcase_04 AC 70 ms
6,944 KB
testcase_05 AC 72 ms
6,940 KB
testcase_06 AC 74 ms
6,944 KB
testcase_07 AC 74 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")

#include <cstdio>
char A[500000];
int main() {
  unsigned N,Q; scanf("%u%u", &N, &Q);
  for(unsigned i = 0; i != N; ++i) {
    unsigned a; scanf("%u", &a);
    A[i] = (a == 0 ? 0 : 0xff);
  }
  for(unsigned i = 0; i != Q; ++i) {
    unsigned L,R; scanf("%u%u", &L, &R);
    --L;
    unsigned len = R - L;
    for(unsigned j = 0; j != len; ++j) A[j+L] = ~A[j+L];
  }
  for(unsigned i = 0; i != N; ++i) {
    putchar(A[i] == 0 ? '0': '1');
    putchar(' ');
  }
}
0