結果

問題 No.1091 Range Xor Query
ユーザー yuruhiyayuruhiya
提出日時 2020-06-26 12:21:07
言語 Crystal
(1.11.2)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 20,726 ms
コンパイル使用メモリ 253,104 KB
実行使用メモリ 19,712 KB
最終ジャッジ日時 2023-09-13 10:52:40
合計ジャッジ時間 25,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,404 KB
testcase_01 AC 2 ms
4,460 KB
testcase_02 AC 3 ms
4,384 KB
testcase_03 AC 35 ms
12,300 KB
testcase_04 AC 197 ms
6,472 KB
testcase_05 AC 205 ms
19,620 KB
testcase_06 AC 7 ms
6,380 KB
testcase_07 AC 206 ms
12,220 KB
testcase_08 AC 308 ms
16,104 KB
testcase_09 AC 147 ms
7,640 KB
testcase_10 AC 209 ms
16,100 KB
testcase_11 AC 260 ms
16,112 KB
testcase_12 AC 149 ms
19,664 KB
testcase_13 AC 323 ms
12,152 KB
testcase_14 AC 225 ms
16,064 KB
testcase_15 AC 234 ms
16,088 KB
testcase_16 AC 241 ms
7,608 KB
testcase_17 AC 314 ms
16,156 KB
testcase_18 AC 51 ms
6,064 KB
testcase_19 AC 53 ms
12,168 KB
testcase_20 AC 308 ms
12,192 KB
testcase_21 AC 150 ms
6,100 KB
testcase_22 AC 297 ms
16,212 KB
testcase_23 AC 319 ms
19,660 KB
testcase_24 AC 327 ms
19,580 KB
testcase_25 AC 320 ms
19,584 KB
testcase_26 AC 319 ms
19,532 KB
testcase_27 AC 325 ms
19,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = read_line.split.map &.to_i
a = read_line.split.map &.to_i
a.unshift(0)
(1..n).each { |i| a[i] ^= a[i - 1] }
q.times do
  l, r = read_line.split.map &.to_i
  puts a[r] ^ a[l - 1]
end
0