結果

問題 No.1072 A Nice XOR Pair
ユーザー anagohirameanagohirame
提出日時 2020-06-05 21:35:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 333 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 29,468 KB
最終ジャッジ日時 2023-08-22 14:33:57
合計ジャッジ時間 2,708 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,608 KB
testcase_01 AC 18 ms
8,448 KB
testcase_02 AC 18 ms
8,636 KB
testcase_03 AC 18 ms
8,472 KB
testcase_04 AC 18 ms
8,552 KB
testcase_05 AC 17 ms
8,544 KB
testcase_06 AC 21 ms
8,744 KB
testcase_07 AC 333 ms
29,464 KB
testcase_08 AC 244 ms
8,460 KB
testcase_09 AC 247 ms
8,520 KB
testcase_10 AC 243 ms
8,516 KB
testcase_11 AC 293 ms
13,808 KB
testcase_12 AC 323 ms
29,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys
def input():
	return sys.stdin.buffer.readline()[:-1]

n, x = map(int, input().split())
c = Counter()
ans = 0
for _ in range(n):
	a = int(input())
	ans += c[a^x]
	c[a] += 1
print(ans)
0