結果

問題 No.1091 Range Xor Query
ユーザー mochidanmochidan
提出日時 2020-06-29 14:41:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 382 ms / 2,000 ms
コード長 1,005 bytes
コンパイル時間 1,839 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 129,996 KB
最終ジャッジ日時 2023-09-25 15:45:56
合計ジャッジ時間 13,096 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 250 ms
91,780 KB
testcase_01 AC 243 ms
91,724 KB
testcase_02 AC 243 ms
91,564 KB
testcase_03 AC 303 ms
118,468 KB
testcase_04 AC 317 ms
97,912 KB
testcase_05 AC 356 ms
121,160 KB
testcase_06 AC 271 ms
96,392 KB
testcase_07 AC 334 ms
112,520 KB
testcase_08 AC 360 ms
118,568 KB
testcase_09 AC 309 ms
99,692 KB
testcase_10 AC 348 ms
122,824 KB
testcase_11 AC 370 ms
118,028 KB
testcase_12 AC 341 ms
118,040 KB
testcase_13 AC 362 ms
115,564 KB
testcase_14 AC 353 ms
122,632 KB
testcase_15 AC 362 ms
118,000 KB
testcase_16 AC 330 ms
100,700 KB
testcase_17 AC 382 ms
115,236 KB
testcase_18 AC 280 ms
94,368 KB
testcase_19 AC 308 ms
115,868 KB
testcase_20 AC 365 ms
115,692 KB
testcase_21 AC 299 ms
94,488 KB
testcase_22 AC 370 ms
126,616 KB
testcase_23 AC 382 ms
129,996 KB
testcase_24 AC 377 ms
129,672 KB
testcase_25 AC 374 ms
129,960 KB
testcase_26 AC 374 ms
129,780 KB
testcase_27 AC 377 ms
129,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,Q = inputMap()
	A = inputList()
	rep = []

	for i,val in enumerate(A):
		if i == 0:
			rep.append(val)
		else:
			rep.append(val ^ rep[i-1])

	rep = [0] + rep

	for i in range(Q):
		l,r = inputMap()
		ans = rep[l-1] ^ rep[r]
		print(ans)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()
0