結果

問題 No.1072 A Nice XOR Pair
ユーザー uni_python
提出日時 2020-06-16 22:52:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 529 bytes
コンパイル時間 474 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 128,416 KB
最終ジャッジ日時 2024-07-03 12:01:05
合計ジャッジ時間 2,415 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7

def main():
    N,X=MI()
    A=[0]*N
    B=[0]*N
    
    from collections import defaultdict
    ddA = defaultdict(int)
    ddB = defaultdict(int)
    
    for i in range(N):
        A[i]=I()
        ddA[A[i]]+=1
        B[i]=A[i]^X
        ddB[B[i]]+=1
        
    ans=0
    for k,v in ddA.items():
        ans+=v*ddB[k]
        
    print(ans//2)


main()
0