結果

問題 No.1091 Range Xor Query
ユーザー trineutrontrineutron
提出日時 2020-06-24 07:09:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,200 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 31,120 KB
最終ジャッジ日時 2023-09-16 20:49:09
合計ジャッジ時間 23,587 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,796 KB
testcase_02 AC 15 ms
7,800 KB
testcase_03 AC 148 ms
22,272 KB
testcase_04 AC 699 ms
11,652 KB
testcase_05 AC 736 ms
31,120 KB
testcase_06 AC 35 ms
11,904 KB
testcase_07 AC 790 ms
19,852 KB
testcase_08 AC 1,113 ms
22,412 KB
testcase_09 AC 555 ms
12,888 KB
testcase_10 AC 759 ms
25,912 KB
testcase_11 AC 988 ms
28,356 KB
testcase_12 AC 536 ms
29,280 KB
testcase_13 AC 1,151 ms
20,708 KB
testcase_14 AC 812 ms
24,576 KB
testcase_15 AC 863 ms
28,840 KB
testcase_16 AC 890 ms
12,700 KB
testcase_17 AC 1,176 ms
26,848 KB
testcase_18 AC 190 ms
10,328 KB
testcase_19 AC 216 ms
21,616 KB
testcase_20 AC 1,150 ms
19,900 KB
testcase_21 AC 552 ms
10,424 KB
testcase_22 AC 1,050 ms
26,324 KB
testcase_23 AC 1,156 ms
30,988 KB
testcase_24 AC 1,163 ms
30,984 KB
testcase_25 AC 1,200 ms
30,980 KB
testcase_26 AC 1,182 ms
30,996 KB
testcase_27 AC 1,184 ms
30,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = map(int, input().split())
a = list(map(int, input().split()))
s = [0] * (n + 1)
for i in range(n):
    s[i + 1] = s[i] ^ a[i]
for i in range(q):
    l, r = map(int, input().split())
    print(s[l - 1] ^ s[r])
0