結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 4 ms
4,372 KB
testcase_07 AC 351 ms
14,236 KB
testcase_08 AC 107 ms
5,048 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 225 ms
9,108 KB
testcase_12 AC 323 ms
13,584 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
	if(x = 0b64)
		do ans :- n
	end if
	do cui@print("\{ans}\n")
end func
0