結果

問題 No.1072 A Nice XOR Pair
ユーザー NagisaNagisa
提出日時 2020-06-06 11:05:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 31,628 KB
最終ジャッジ日時 2023-08-24 23:20:19
合計ジャッジ時間 2,671 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,456 KB
testcase_01 AC 18 ms
8,432 KB
testcase_02 AC 18 ms
8,420 KB
testcase_03 AC 18 ms
8,580 KB
testcase_04 WA -
testcase_05 AC 18 ms
8,608 KB
testcase_06 AC 21 ms
8,752 KB
testcase_07 AC 317 ms
31,628 KB
testcase_08 AC 133 ms
16,228 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 186 ms
20,176 KB
testcase_12 AC 198 ms
31,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import Counter
def input():
    return sys.stdin.readline()[:-1]
def main():
    N, X = map(int,input().split())
    A = [int(input()) for _ in range(N)]
    C = Counter(A)
    ans = 0
    for e in C:
        if e^X in C:
            ans += C[e]*C[e^X]
            C[e^X] = 0
    print(ans)
if __name__ == '__main__':
    main()
0