結果

問題 No.1091 Range Xor Query
ユーザー ThetaTheta
提出日時 2022-10-20 11:23:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,139 ms / 2,000 ms
コード長 334 bytes
コンパイル時間 322 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 31,156 KB
最終ジャッジ日時 2023-09-12 17:31:22
合計ジャッジ時間 24,399 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,812 KB
testcase_01 AC 15 ms
7,784 KB
testcase_02 AC 14 ms
7,840 KB
testcase_03 AC 124 ms
22,096 KB
testcase_04 AC 688 ms
11,624 KB
testcase_05 AC 689 ms
31,156 KB
testcase_06 AC 29 ms
11,900 KB
testcase_07 AC 741 ms
19,872 KB
testcase_08 AC 1,028 ms
22,424 KB
testcase_09 AC 528 ms
12,848 KB
testcase_10 AC 709 ms
25,876 KB
testcase_11 AC 918 ms
28,392 KB
testcase_12 AC 502 ms
29,276 KB
testcase_13 AC 1,106 ms
20,816 KB
testcase_14 AC 769 ms
24,592 KB
testcase_15 AC 810 ms
28,856 KB
testcase_16 AC 839 ms
12,604 KB
testcase_17 AC 1,106 ms
26,820 KB
testcase_18 AC 181 ms
10,508 KB
testcase_19 AC 188 ms
21,556 KB
testcase_20 AC 1,058 ms
19,968 KB
testcase_21 AC 527 ms
10,464 KB
testcase_22 AC 983 ms
26,392 KB
testcase_23 AC 1,118 ms
30,952 KB
testcase_24 AC 1,126 ms
30,972 KB
testcase_25 AC 1,139 ms
30,964 KB
testcase_26 AC 1,130 ms
30,932 KB
testcase_27 AC 1,133 ms
31,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N, Q = map(int, input().split())
    a = list(map(int, input().split()))
    partial_xor = [0]
    for elm in a:

        partial_xor.append(partial_xor[-1] ^ elm)

    for _ in range(Q):
        l, r = map(int, input().split())
        print(partial_xor[l-1] ^ partial_xor[r])


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