結果

問題 No.1072 A Nice XOR Pair
ユーザー GrayCoderGrayCoder
提出日時 2020-06-05 22:55:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 33,968 KB
最終ジャッジ日時 2023-08-22 16:54:50
合計ジャッジ時間 2,538 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,372 KB
testcase_01 AC 19 ms
8,408 KB
testcase_02 AC 18 ms
8,452 KB
testcase_03 AC 19 ms
8,568 KB
testcase_04 WA -
testcase_05 AC 18 ms
8,392 KB
testcase_06 AC 20 ms
8,592 KB
testcase_07 AC 254 ms
33,960 KB
testcase_08 AC 177 ms
17,728 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 218 ms
21,116 KB
testcase_12 AC 236 ms
33,968 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 = a ^ X
        ans += cnt[n]
    print(ans // 2)


main()

0