結果

問題 No.1072 A Nice XOR Pair
ユーザー umashi-pan-tnokk093numashi-pan-tnokk093n
提出日時 2020-06-06 12:50:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 282 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 41,252 KB
最終ジャッジ日時 2023-08-25 00:31:13
合計ジャッジ時間 4,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,756 KB
testcase_01 AC 15 ms
7,820 KB
testcase_02 AC 15 ms
7,828 KB
testcase_03 AC 16 ms
7,864 KB
testcase_04 WA -
testcase_05 AC 16 ms
7,832 KB
testcase_06 AC 22 ms
8,292 KB
testcase_07 AC 654 ms
41,088 KB
testcase_08 AC 456 ms
16,044 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 562 ms
25,236 KB
testcase_12 AC 590 ms
41,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x=map(int,input().split())
a=[]
b=dict()
for i in range(n):
    num=int(input())
    a.append(num)
    if num not in b:
        b[num]=1
    else:
        b[num]+=1

c=list(set(a))
#print(b)
#print(c)
ans=0
for i in c:
    m=x^i
    if m in b:
        ans+=b[m]*b[i]
print(ans//2)
0