結果

問題 No.1072 A Nice XOR Pair
ユーザー 👑 H20H20
提出日時 2021-01-20 15:15:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 255 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 118,148 KB
最終ジャッジ日時 2023-08-24 19:13:54
合計ジャッジ時間 3,915 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,452 KB
testcase_01 AC 94 ms
71,452 KB
testcase_02 AC 93 ms
71,268 KB
testcase_03 AC 93 ms
71,544 KB
testcase_04 AC 92 ms
71,488 KB
testcase_05 AC 92 ms
71,788 KB
testcase_06 AC 119 ms
77,680 KB
testcase_07 AC 255 ms
118,148 KB
testcase_08 AC 194 ms
85,168 KB
testcase_09 AC 193 ms
85,204 KB
testcase_10 AC 196 ms
85,192 KB
testcase_11 AC 222 ms
95,908 KB
testcase_12 AC 240 ms
110,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N,X = map(int,input().split())
L = []
for i in range(N):
   L.append(int(input()))
CL = collections.Counter(L)
ans = 0
if X!=0:
   for k,v in CL.items():
      ans += v * CL[k^X]
   ans = ans//2
else:
   for k,v in CL.items():
      ans += v * (v-1) //2

print(ans)
0