結果

問題 No.1072 A Nice XOR Pair
ユーザー ntuda
提出日時 2024-01-27 16:35:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 82,524 KB
実行使用メモリ 109,092 KB
最終ジャッジ日時 2024-09-28 09:41:55
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
from collections import defaultdict

dic = defaultdict(int)
for a in A:
    dic[a] += 1
ans = 0
for k, v in dic.items():
    if k ^ X in dic:
        ans += dic[k] * dic[k ^ X]
print(ans // 2)
0