結果
| 問題 |
No.1072 A Nice XOR Pair
|
| コンテスト | |
| ユーザー |
wattaihei
|
| 提出日時 | 2020-06-05 21:37:33 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 356 bytes |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 34,024 KB |
| 最終ジャッジ日時 | 2024-12-17 13:44:31 |
| 合計ジャッジ時間 | 2,320 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 3 |
ソースコード
import sys
input = sys.stdin.readline
from collections import Counter
N, X = map(int, input().split())
A = [int(input()) for _ in range(N)]
C = Counter(A)
ans = 0
if X == 0:
for c, num in C.items():
ans += c*(c-1)//2
else:
for c, num in C.items():
b = c ^ X
if b in C:
ans += C[b]*num
ans //= 2
print(ans)
wattaihei