結果

問題 No.1072 A Nice XOR Pair
ユーザー 👑 Kazun
提出日時 2020-06-05 21:28:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 106,896 KB
最終ジャッジ日時 2024-12-17 13:24:41
合計ジャッジ時間 2,220 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X=map(int,input().split())
A={}
U=set()

for i in range(N):
    a=int(input())
    U.add(a)
    if a in A:
        A[a]+=1
    else:
        A[a]=1

S=0
while U:
    x=U.pop()
    if X^x in U:
        y=X^x
        U.remove(y)
        S+=A[x]*A[y]

print(S)
0