結果

問題 No.1072 A Nice XOR Pair
ユーザー d9etd9et
提出日時 2020-06-05 21:27:23
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 100,516 KB
最終ジャッジ日時 2023-08-22 14:13:42
合計ジャッジ時間 3,232 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
71,516 KB
testcase_01 AC 88 ms
71,368 KB
testcase_02 AC 89 ms
71,864 KB
testcase_03 AC 90 ms
71,692 KB
testcase_04 AC 91 ms
71,760 KB
testcase_05 AC 89 ms
71,592 KB
testcase_06 AC 115 ms
77,840 KB
testcase_07 AC 269 ms
94,728 KB
testcase_08 AC 183 ms
77,748 KB
testcase_09 AC 180 ms
77,772 KB
testcase_10 AC 184 ms
78,052 KB
testcase_11 AC 236 ms
87,728 KB
testcase_12 AC 273 ms
100,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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