結果

問題 No.1091 Range Xor Query
ユーザー kept1994kept1994
提出日時 2021-08-28 15:29:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 542 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,388 KB
実行使用メモリ 119,552 KB
最終ジャッジ日時 2024-05-01 15:59:32
合計ジャッジ時間 12,295 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 35 ms
52,352 KB
testcase_02 AC 35 ms
52,224 KB
testcase_03 AC 129 ms
102,192 KB
testcase_04 AC 346 ms
80,512 KB
testcase_05 AC 361 ms
117,672 KB
testcase_06 AC 61 ms
71,936 KB
testcase_07 AC 368 ms
95,744 KB
testcase_08 AC 506 ms
102,016 KB
testcase_09 AC 281 ms
82,052 KB
testcase_10 AC 366 ms
105,472 KB
testcase_11 AC 454 ms
112,372 KB
testcase_12 AC 285 ms
114,432 KB
testcase_13 AC 517 ms
98,580 KB
testcase_14 AC 408 ms
105,628 KB
testcase_15 AC 409 ms
114,304 KB
testcase_16 AC 415 ms
83,012 KB
testcase_17 AC 524 ms
110,080 KB
testcase_18 AC 144 ms
77,568 KB
testcase_19 AC 155 ms
99,072 KB
testcase_20 AC 501 ms
97,736 KB
testcase_21 AC 273 ms
78,080 KB
testcase_22 AC 506 ms
108,312 KB
testcase_23 AC 542 ms
119,296 KB
testcase_24 AC 524 ms
119,424 KB
testcase_25 AC 539 ms
119,552 KB
testcase_26 AC 535 ms
119,500 KB
testcase_27 AC 535 ms
119,168 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)
    for _ in range(Q):
        l, r = map(int,input().split())
        print(xA[l - 1] ^ xA[r])
    return

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