結果

問題 No.2879 Range Flip Queries
ユーザー nouka28nouka28
提出日時 2024-09-08 13:10:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 515 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 144,764 KB
最終ジャッジ日時 2024-09-08 13:10:25
合計ジャッジ時間 13,913 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,492 KB
testcase_01 AC 36 ms
53,140 KB
testcase_02 AC 35 ms
53,144 KB
testcase_03 AC 258 ms
76,416 KB
testcase_04 AC 254 ms
76,028 KB
testcase_05 AC 257 ms
76,368 KB
testcase_06 AC 255 ms
75,976 KB
testcase_07 AC 258 ms
76,172 KB
testcase_08 AC 44 ms
60,764 KB
testcase_09 AC 40 ms
53,224 KB
testcase_10 AC 41 ms
58,880 KB
testcase_11 AC 41 ms
54,776 KB
testcase_12 AC 45 ms
60,804 KB
testcase_13 AC 367 ms
118,128 KB
testcase_14 AC 389 ms
123,476 KB
testcase_15 AC 287 ms
96,420 KB
testcase_16 AC 173 ms
102,440 KB
testcase_17 AC 313 ms
131,228 KB
testcase_18 AC 492 ms
140,720 KB
testcase_19 AC 492 ms
141,136 KB
testcase_20 AC 470 ms
140,848 KB
testcase_21 AC 515 ms
144,508 KB
testcase_22 AC 469 ms
140,892 KB
testcase_23 AC 479 ms
140,768 KB
testcase_24 AC 493 ms
144,440 KB
testcase_25 AC 510 ms
144,612 KB
testcase_26 AC 480 ms
144,612 KB
testcase_27 AC 466 ms
144,376 KB
testcase_28 AC 489 ms
144,408 KB
testcase_29 AC 409 ms
144,764 KB
testcase_30 AC 410 ms
144,456 KB
testcase_31 AC 402 ms
144,604 KB
testcase_32 AC 403 ms
144,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,q=map(int,input().split())
s=list(map(int,input().split()))
a=[0]*(n+1)
for i in range(q):
    l,r=map(int,input().split())
    l-=1
    a[l]^=1
    a[r]^=1

for i in range(n):
    a[i+1]^=a[i]
    s[i]^=a[i]
print(*s)
0