結果

問題 No.1072 A Nice XOR Pair
ユーザー 👑 tatt61880tatt61880
提出日時 2021-03-21 22:43:21
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 414 bytes
コンパイル時間 2,284 ms
コンパイル使用メモリ 153,396 KB
実行使用メモリ 14,472 KB
最終ジャッジ日時 2023-10-14 17:53:27
合計ジャッジ時間 4,777 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 4 ms
4,352 KB
testcase_07 AC 381 ms
14,472 KB
testcase_08 AC 107 ms
4,916 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 243 ms
9,156 KB
testcase_12 AC 361 ms
13,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var n: int :: cui@inputInt()
	var x: bit64 :: cui@inputInt() $ bit64
	var a: []bit64 :: #[n]bit64
	var dic: dict<bit64, int> :: #dict<bit64, int>
	for i(0, n - 1)
		do a[i] :: cui@inputInt() $ bit64
		var xor: bit64 :: a[i].xor(x)
		do dic.add(xor, dic.get(xor, &) + 1)
	end for
	var ans: int :: 0
	for i(0, n - 1)
		do ans :+ dic.get(a[i], &)
	end for
	do ans :/ 2
	do cui@print("\{ans}\n")
end func
0