結果

問題 No.1072 A Nice XOR Pair
ユーザー pluto77pluto77
提出日時 2020-06-09 11:37:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 615 ms / 2,000 ms
コード長 168 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 29,376 KB
最終ジャッジ日時 2023-08-30 04:11:27
合計ジャッジ時間 5,255 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,524 KB
testcase_01 AC 18 ms
8,468 KB
testcase_02 AC 19 ms
8,460 KB
testcase_03 AC 18 ms
8,520 KB
testcase_04 AC 18 ms
8,420 KB
testcase_05 AC 19 ms
8,432 KB
testcase_06 AC 23 ms
8,692 KB
testcase_07 AC 615 ms
29,332 KB
testcase_08 AC 472 ms
8,376 KB
testcase_09 AC 471 ms
8,460 KB
testcase_10 AC 480 ms
8,432 KB
testcase_11 AC 562 ms
18,880 KB
testcase_12 AC 610 ms
29,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1072
from collections import defaultdict
n,x=map(int,input().split())
d=defaultdict(int)
res=0
for i in range(n):
 a=int(input())
 res+=d[x^a]
 d[a]+=1
print(res)
0