結果

問題 No.1091 Range Xor Query
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-13 15:02:43
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 384 ms / 2,000 ms
コード長 423 bytes
コンパイル時間 2,631 ms
コンパイル使用メモリ 150,248 KB
実行使用メモリ 6,596 KB
最終ジャッジ日時 2023-10-14 17:39:26
合計ジャッジ時間 15,414 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 64 ms
5,640 KB
testcase_04 AC 212 ms
4,352 KB
testcase_05 AC 254 ms
6,168 KB
testcase_06 AC 15 ms
4,352 KB
testcase_07 AC 236 ms
5,012 KB
testcase_08 AC 350 ms
5,604 KB
testcase_09 AC 173 ms
4,348 KB
testcase_10 AC 248 ms
5,640 KB
testcase_11 AC 321 ms
5,900 KB
testcase_12 AC 207 ms
6,340 KB
testcase_13 AC 371 ms
5,228 KB
testcase_14 AC 271 ms
5,868 KB
testcase_15 AC 311 ms
6,264 KB
testcase_16 AC 276 ms
4,352 KB
testcase_17 AC 384 ms
6,068 KB
testcase_18 AC 58 ms
4,352 KB
testcase_19 AC 83 ms
5,208 KB
testcase_20 AC 331 ms
5,240 KB
testcase_21 AC 163 ms
4,348 KB
testcase_22 AC 329 ms
5,900 KB
testcase_23 AC 376 ms
6,556 KB
testcase_24 AC 368 ms
6,432 KB
testcase_25 AC 376 ms
6,596 KB
testcase_26 AC 376 ms
6,588 KB
testcase_27 AC 379 ms
6,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var q: int :: cui@inputInt()
	var a: []int :: #[n]int
	for i(0, n - 1)
		do a[i] :: cui@inputInt()
	end for
	
	var cum: []bit64 :: #[n + 1]bit64
	for i(1, n)
		do cum[i] :: cum[i - 1].xor(a[i - 1] $ bit64)
	end for
	for(1, q)
		var l: int :: cui@inputInt()
		var r: int :: cui@inputInt()
		var ans: int :: cum[r].xor(cum[l - 1]) $ int
		do cui@print("\{ans}\n")
	end for
end func
0