結果

問題 No.1091 Range Xor Query
ユーザー 小野寺健小野寺健
提出日時 2021-11-05 15:17:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 658 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 33,448 KB
最終ジャッジ日時 2024-04-23 23:21:16
合計ジャッジ時間 14,058 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
12,160 KB
testcase_01 AC 76 ms
12,160 KB
testcase_02 AC 76 ms
12,288 KB
testcase_03 AC 167 ms
23,168 KB
testcase_04 AC 402 ms
22,356 KB
testcase_05 AC 423 ms
29,696 KB
testcase_06 AC 94 ms
14,464 KB
testcase_07 AC 429 ms
23,116 KB
testcase_08 AC 573 ms
27,512 KB
testcase_09 AC 316 ms
19,532 KB
testcase_10 AC 400 ms
26,368 KB
testcase_11 AC 522 ms
28,160 KB
testcase_12 AC 338 ms
29,696 KB
testcase_13 AC 623 ms
28,900 KB
testcase_14 AC 449 ms
26,240 KB
testcase_15 AC 464 ms
29,056 KB
testcase_16 AC 472 ms
25,288 KB
testcase_17 AC 595 ms
29,668 KB
testcase_18 AC 156 ms
15,048 KB
testcase_19 AC 191 ms
22,272 KB
testcase_20 AC 583 ms
27,520 KB
testcase_21 AC 316 ms
18,688 KB
testcase_22 AC 545 ms
29,012 KB
testcase_23 AC 647 ms
33,408 KB
testcase_24 AC 658 ms
33,316 KB
testcase_25 AC 655 ms
33,316 KB
testcase_26 AC 651 ms
33,280 KB
testcase_27 AC 651 ms
33,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, Q = gets.split(" ").map{|s| s.to_i}
a = gets.split(" ").map{|s| s.to_i}

q = []
Q.times {
	q << gets.split(" ").map{|s| s.to_i}
}

sx = Array.new(N+1, 0)
0.upto(N-1) {|i|
	sx[i+1] = sx[i] ^ a[i]
}

q.each {|l, r|
	puts sx[l-1] ^ sx[r]
}
0