結果

問題 No.1072 A Nice XOR Pair
ユーザー stng
提出日時 2022-09-01 20:11:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 213 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 82,272 KB
実行使用メモリ 127,084 KB
最終ジャッジ日時 2024-11-14 11:33:06
合計ジャッジ時間 2,634 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n,x = map(int,input().split())
a = [int(input()) for i in range(n)]

d = defaultdict(int)
#for i in range(n):
#    d[a[i]] += 1

ans = 0

for i in range(n):
    ans += d[a[i]^x]
    d[a[i]] += 1
print(ans)
0