結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,880 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 71 ms
6,940 KB
testcase_04 AC 70 ms
6,940 KB
testcase_05 AC 71 ms
6,940 KB
testcase_06 AC 73 ms
6,944 KB
testcase_07 AC 79 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 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("avx512f")
#pragma GCC target("avx512vl")

#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