結果

問題 No.1072 A Nice XOR Pair
ユーザー brthyyjpbrthyyjp
提出日時 2020-06-05 21:35:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 204 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 110,256 KB
最終ジャッジ日時 2023-08-22 14:32:43
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,352 KB
testcase_01 AC 69 ms
71,248 KB
testcase_02 AC 71 ms
71,296 KB
testcase_03 AC 70 ms
71,448 KB
testcase_04 AC 71 ms
71,328 KB
testcase_05 AC 71 ms
71,264 KB
testcase_06 AC 96 ms
76,880 KB
testcase_07 AC 204 ms
110,256 KB
testcase_08 AC 166 ms
78,932 KB
testcase_09 AC 165 ms
78,760 KB
testcase_10 AC 172 ms
78,760 KB
testcase_11 AC 188 ms
87,836 KB
testcase_12 AC 201 ms
97,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x = map(int, input().split())
A = [int(input()) for _ in range(n)]
d = {}
ans = 0
for i in range(n):
    if A[i] in d:
        ans += d[A[i]]
    if A[i]^x in d:
        d[A[i]^x] += 1
    else:
        d[A[i]^x] = 1
print(ans)
0