結果

問題 No.1072 A Nice XOR Pair
ユーザー kbyskbys
提出日時 2020-06-22 19:17:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 267 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 149,084 KB
最終ジャッジ日時 2023-09-16 19:19:14
合計ジャッジ時間 4,923 ms
ジャッジサーバーID
(参考情報)
judge13 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,700 KB
testcase_01 AC 97 ms
71,568 KB
testcase_02 AC 92 ms
71,628 KB
testcase_03 AC 90 ms
71,532 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 134 ms
77,728 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

N, X = map(int,input().split())

A = [0]*N
for i in range(N):
    A[i] = int(input())
    
cards = set(A)
cnt = collections.Counter(A)

ans = 0 
for key, value in cnt.items():
    if X^key in A:
        ans += value*cnt[key]
        
print(ans//2)
0