結果

問題 No.1072 A Nice XOR Pair
ユーザー GrayCoderGrayCoder
提出日時 2020-06-05 23:11:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 33,948 KB
最終ジャッジ日時 2023-08-22 17:28:37
合計ジャッジ時間 2,507 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,592 KB
testcase_01 AC 18 ms
8,416 KB
testcase_02 AC 18 ms
8,592 KB
testcase_03 AC 18 ms
8,488 KB
testcase_04 WA -
testcase_05 AC 18 ms
8,568 KB
testcase_06 AC 20 ms
8,652 KB
testcase_07 AC 237 ms
33,948 KB
testcase_08 AC 175 ms
17,756 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 216 ms
21,136 KB
testcase_12 AC 224 ms
33,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, X = map(int, input().split())
    A = [int(input()) for _ in [0] * N]

    cnt = Counter(A)
    ans = 0
    for a in A:
        n = X ^ a
        ans += cnt[n]
    print(ans // 2)


main()
0