結果

問題 No.2879 Range Flip Queries
ユーザー ルクルク
提出日時 2024-09-08 12:46:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 555 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 82,376 KB
実行使用メモリ 161,616 KB
最終ジャッジ日時 2024-09-08 12:46:48
合計ジャッジ時間 14,338 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,232 KB
testcase_01 AC 35 ms
52,124 KB
testcase_02 AC 35 ms
52,872 KB
testcase_03 AC 251 ms
76,004 KB
testcase_04 AC 241 ms
76,028 KB
testcase_05 AC 265 ms
76,244 KB
testcase_06 AC 252 ms
76,088 KB
testcase_07 AC 258 ms
76,160 KB
testcase_08 AC 43 ms
61,252 KB
testcase_09 AC 37 ms
53,072 KB
testcase_10 AC 40 ms
59,408 KB
testcase_11 AC 42 ms
56,012 KB
testcase_12 AC 42 ms
60,280 KB
testcase_13 AC 398 ms
122,720 KB
testcase_14 AC 411 ms
128,444 KB
testcase_15 AC 305 ms
98,904 KB
testcase_16 AC 178 ms
104,972 KB
testcase_17 AC 345 ms
141,476 KB
testcase_18 AC 494 ms
152,832 KB
testcase_19 AC 525 ms
151,756 KB
testcase_20 AC 515 ms
152,088 KB
testcase_21 AC 518 ms
152,056 KB
testcase_22 AC 494 ms
152,056 KB
testcase_23 AC 555 ms
160,640 KB
testcase_24 AC 499 ms
161,324 KB
testcase_25 AC 493 ms
161,616 KB
testcase_26 AC 501 ms
161,576 KB
testcase_27 AC 505 ms
161,248 KB
testcase_28 AC 537 ms
161,448 KB
testcase_29 AC 423 ms
161,448 KB
testcase_30 AC 451 ms
161,320 KB
testcase_31 AC 433 ms
161,188 KB
testcase_32 AC 452 ms
161,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=[0]*(n+1)
b=list(map(int,input().split()))+[0]
for i in range(m):
    l,r=map(int,input().split())
    a[l-1]+=1
    a[r]-=1
for i in range(n):
    a[i+1]+=a[i]
ans=[]
for i in range(n):
    ans.append((a[i]+b[i])%2)
print(*ans)
0