結果

問題 No.1072 A Nice XOR Pair
ユーザー takakintakakin
提出日時 2020-06-05 21:41:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 301 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 10,632 KB
実行使用メモリ 29,496 KB
最終ジャッジ日時 2023-08-22 14:46:11
合計ジャッジ時間 2,664 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,400 KB
testcase_01 AC 17 ms
8,616 KB
testcase_02 AC 17 ms
8,580 KB
testcase_03 AC 17 ms
8,524 KB
testcase_04 AC 17 ms
8,520 KB
testcase_05 AC 17 ms
8,472 KB
testcase_06 AC 19 ms
8,612 KB
testcase_07 AC 289 ms
29,360 KB
testcase_08 AC 203 ms
8,424 KB
testcase_09 AC 201 ms
8,616 KB
testcase_10 AC 202 ms
8,592 KB
testcase_11 AC 249 ms
18,952 KB
testcase_12 AC 301 ms
29,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n,x=map(int,input().split())
import collections
D=collections.defaultdict(int)
ans=0
for i in range(n):
  a=int(input())
  ans+=D[a^x]
  D[a]+=1
print(ans)
0