結果

問題 No.1091 Range Xor Query
ユーザー laneguelanegue
提出日時 2020-06-25 23:42:47
言語 Crystal
(1.11.2)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 18,312 ms
コンパイル使用メモリ 254,592 KB
実行使用メモリ 19,648 KB
最終ジャッジ日時 2023-09-13 10:48:57
合計ジャッジ時間 29,047 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,468 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,544 KB
testcase_03 AC 35 ms
12,012 KB
testcase_04 AC 193 ms
6,512 KB
testcase_05 AC 213 ms
19,596 KB
testcase_06 AC 8 ms
6,544 KB
testcase_07 AC 214 ms
12,252 KB
testcase_08 AC 321 ms
16,132 KB
testcase_09 AC 148 ms
7,540 KB
testcase_10 AC 219 ms
16,116 KB
testcase_11 AC 264 ms
16,072 KB
testcase_12 AC 156 ms
19,592 KB
testcase_13 AC 328 ms
12,112 KB
testcase_14 AC 239 ms
16,120 KB
testcase_15 AC 233 ms
16,196 KB
testcase_16 AC 245 ms
7,576 KB
testcase_17 AC 317 ms
16,024 KB
testcase_18 AC 51 ms
6,088 KB
testcase_19 AC 54 ms
12,196 KB
testcase_20 AC 312 ms
11,864 KB
testcase_21 AC 152 ms
6,116 KB
testcase_22 AC 307 ms
15,788 KB
testcase_23 AC 320 ms
19,596 KB
testcase_24 AC 329 ms
19,648 KB
testcase_25 AC 319 ms
19,612 KB
testcase_26 AC 322 ms
19,564 KB
testcase_27 AC 325 ms
19,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = read_line.split.map{|i|i.to_i}
a = read_line.split.map{|i|i.to_i}
xor = [0]
a.each{|ai|
    xor << (xor[-1] ^ ai)
}
q.times{
    l, r = read_line.split.map{|i|i.to_i}
    puts xor[l - 1] ^ xor[r]
}
0