結果

問題 No.1091 Range Xor Query
ユーザー roarisroaris
提出日時 2020-06-24 03:14:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 349 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 121,940 KB
最終ジャッジ日時 2023-09-16 20:37:23
合計ジャッジ時間 7,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,332 KB
testcase_01 AC 67 ms
71,312 KB
testcase_02 AC 66 ms
71,284 KB
testcase_03 AC 125 ms
111,476 KB
testcase_04 AC 136 ms
82,344 KB
testcase_05 AC 176 ms
119,408 KB
testcase_06 AC 86 ms
81,428 KB
testcase_07 AC 155 ms
103,076 KB
testcase_08 AC 180 ms
111,604 KB
testcase_09 AC 124 ms
84,768 KB
testcase_10 AC 167 ms
116,408 KB
testcase_11 AC 191 ms
114,148 KB
testcase_12 AC 163 ms
116,348 KB
testcase_13 AC 196 ms
107,028 KB
testcase_14 AC 169 ms
116,332 KB
testcase_15 AC 182 ms
115,800 KB
testcase_16 AC 145 ms
86,204 KB
testcase_17 AC 195 ms
121,940 KB
testcase_18 AC 103 ms
78,692 KB
testcase_19 AC 125 ms
107,492 KB
testcase_20 AC 177 ms
105,212 KB
testcase_21 AC 116 ms
78,748 KB
testcase_22 AC 188 ms
119,092 KB
testcase_23 AC 190 ms
107,740 KB
testcase_24 AC 183 ms
107,764 KB
testcase_25 AC 188 ms
107,772 KB
testcase_26 AC 188 ms
107,780 KB
testcase_27 AC 190 ms
107,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N, Q = map(int, input().split())
a = list(map(int, input().split()))
X = 0

for ai in a:
    X ^= ai

left = [0]

for ai in a:
    left.append(left[-1]^ai)

right = [0]

for ai in a[::-1]:
    right.append(right[-1]^ai)

for _ in range(Q):
    l, r = map(int, input().split())
    print(X^left[l-1]^right[N-r])
0