結果

問題 No.1091 Range Xor Query
ユーザー syunsukesyunsuke
提出日時 2020-09-16 19:46:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 583 ms / 2,000 ms
コード長 335 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 87,368 KB
実行使用メモリ 127,044 KB
最終ジャッジ日時 2023-09-04 03:49:48
合計ジャッジ時間 15,891 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,340 KB
testcase_01 AC 72 ms
70,944 KB
testcase_02 AC 78 ms
71,072 KB
testcase_03 AC 179 ms
106,480 KB
testcase_04 AC 424 ms
82,240 KB
testcase_05 AC 413 ms
124,580 KB
testcase_06 AC 103 ms
81,248 KB
testcase_07 AC 416 ms
99,992 KB
testcase_08 AC 546 ms
106,988 KB
testcase_09 AC 323 ms
84,280 KB
testcase_10 AC 408 ms
111,348 KB
testcase_11 AC 509 ms
119,128 KB
testcase_12 AC 334 ms
121,808 KB
testcase_13 AC 576 ms
103,124 KB
testcase_14 AC 436 ms
111,204 KB
testcase_15 AC 457 ms
120,928 KB
testcase_16 AC 451 ms
84,964 KB
testcase_17 AC 577 ms
115,864 KB
testcase_18 AC 176 ms
79,220 KB
testcase_19 AC 193 ms
103,444 KB
testcase_20 AC 551 ms
101,852 KB
testcase_21 AC 323 ms
79,344 KB
testcase_22 AC 535 ms
113,832 KB
testcase_23 AC 583 ms
126,768 KB
testcase_24 AC 579 ms
127,044 KB
testcase_25 AC 571 ms
126,864 KB
testcase_26 AC 569 ms
125,424 KB
testcase_27 AC 580 ms
126,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
L=list(map(int,input().split()))
L=[0]+L+[0]
F=[0]
for i in range(1,len(L)):
    F.append(F[-1]^L[i])
#print(F)

E=[0 for i in range(len(F))]
for i in range(1,len(L)):
    E[len(L)-1-i]=E[len(L)-i]^L[len(L)-1-i]
#print(E)

for i in range(Q):
    l,r=map(int,input().split())
    print(F[-1]^F[l-1]^E[r+1])
0