結果

問題 No.1091 Range Xor Query
ユーザー 双六双六
提出日時 2020-08-05 22:57:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 117,480 KB
最終ジャッジ日時 2023-10-17 22:57:35
合計ジャッジ時間 10,247 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,512 KB
testcase_01 AC 41 ms
53,512 KB
testcase_02 AC 41 ms
53,512 KB
testcase_03 AC 99 ms
101,340 KB
testcase_04 AC 117 ms
79,720 KB
testcase_05 AC 156 ms
115,560 KB
testcase_06 AC 57 ms
71,628 KB
testcase_07 AC 140 ms
95,168 KB
testcase_08 AC 174 ms
101,724 KB
testcase_09 AC 110 ms
81,564 KB
testcase_10 AC 150 ms
105,236 KB
testcase_11 AC 172 ms
110,896 KB
testcase_12 AC 140 ms
112,316 KB
testcase_13 AC 168 ms
97,988 KB
testcase_14 AC 149 ms
105,188 KB
testcase_15 AC 160 ms
112,252 KB
testcase_16 AC 133 ms
82,260 KB
testcase_17 AC 186 ms
108,124 KB
testcase_18 AC 78 ms
77,032 KB
testcase_19 AC 101 ms
98,472 KB
testcase_20 AC 168 ms
97,016 KB
testcase_21 AC 101 ms
77,148 KB
testcase_22 AC 170 ms
106,960 KB
testcase_23 AC 173 ms
117,480 KB
testcase_24 AC 171 ms
117,480 KB
testcase_25 AC 173 ms
117,480 KB
testcase_26 AC 173 ms
117,480 KB
testcase_27 AC 171 ms
117,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, Q = getlist()
	A = getlist()
	XOR = [0]
	for i in range(N):
		XOR.append(XOR[-1] ^ A[i])

	for i in range(Q):
		l, r = getlist()
		l -= 1; r -= 1
		ans = XOR[l] ^ XOR[r + 1]
		print(ans)

if __name__ == '__main__':
	main()
0