結果

問題 No.1091 Range Xor Query
ユーザー kept1994kept1994
提出日時 2021-08-28 15:21:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 547 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 81,940 KB
実行使用メモリ 119,224 KB
最終ジャッジ日時 2024-05-01 15:59:09
合計ジャッジ時間 13,753 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,588 KB
testcase_01 AC 35 ms
52,952 KB
testcase_02 AC 36 ms
54,040 KB
testcase_03 AC 132 ms
102,244 KB
testcase_04 AC 344 ms
80,128 KB
testcase_05 AC 359 ms
117,680 KB
testcase_06 AC 57 ms
72,308 KB
testcase_07 AC 367 ms
95,916 KB
testcase_08 AC 497 ms
102,084 KB
testcase_09 AC 277 ms
81,916 KB
testcase_10 AC 355 ms
105,432 KB
testcase_11 AC 455 ms
112,628 KB
testcase_12 AC 308 ms
114,656 KB
testcase_13 AC 522 ms
98,492 KB
testcase_14 AC 385 ms
105,516 KB
testcase_15 AC 417 ms
114,208 KB
testcase_16 AC 405 ms
82,768 KB
testcase_17 AC 530 ms
109,924 KB
testcase_18 AC 143 ms
77,576 KB
testcase_19 AC 154 ms
98,596 KB
testcase_20 AC 509 ms
97,424 KB
testcase_21 AC 274 ms
77,428 KB
testcase_22 AC 477 ms
108,296 KB
testcase_23 AC 547 ms
119,224 KB
testcase_24 AC 530 ms
118,904 KB
testcase_25 AC 518 ms
118,956 KB
testcase_26 AC 525 ms
119,156 KB
testcase_27 AC 525 ms
118,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys


def main():
    # N = int(input())
    N, Q = map(int,input().split())
    A = list(map(int,input().split()))
    xA = [0]
    for aa in A:
        xA.append(xA[-1] ^ aa)
    xA.pop(0)
    for _ in range(Q):
        l, r = map(int,input().split())
        if l - 1 == 0:
            print(xA[r - 1])
        else:
            print(xA[l - 2] ^ xA[r - 1])
    return

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