結果

問題 No.1072 A Nice XOR Pair
ユーザー NoviNovi
提出日時 2020-06-06 14:57:57
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 351 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 10,780 KB
実行使用メモリ 20,588 KB
最終ジャッジ日時 2023-08-25 01:00:10
合計ジャッジ時間 4,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
12,236 KB
testcase_01 AC 14 ms
7,896 KB
testcase_02 AC 14 ms
7,904 KB
testcase_03 AC 14 ms
7,768 KB
testcase_04 AC 15 ms
8,240 KB
testcase_05 AC 14 ms
7,784 KB
testcase_06 AC 74 ms
7,796 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x=map(int,input().split())
a=[int(input()) for i in range(n)]
watch=set([])
ans=0
if x==0:
    for i in range(n):
        y=a[i]
        if not y in watch:
            cnt=a.count(y)
            ans+=cnt*(cnt-1)//2
            watch.add(y)
    print(ans)
    exit()
else:
    for i in range(n):
        b=x^a[i]
        ans+=a.count(b)
print(ans//2)
0