結果

問題 No.1072 A Nice XOR Pair
ユーザー GrayCoderGrayCoder
提出日時 2020-06-05 23:41:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 325 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 43,544 KB
最終ジャッジ日時 2023-08-22 18:22:59
合計ジャッジ時間 5,626 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
34,064 KB
testcase_01 AC 125 ms
29,440 KB
testcase_02 AC 125 ms
29,608 KB
testcase_03 AC 124 ms
29,608 KB
testcase_04 AC 123 ms
29,668 KB
testcase_05 AC 124 ms
29,512 KB
testcase_06 AC 132 ms
30,092 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
from sys import stdin


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

    x = np.array(A)
    ans = 0
    for i, a in enumerate(A):
        n = X ^ a
        ans += np.count_nonzero(x[i+1:] == n)
    print(ans)


main()
0