結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-05 21:59:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 267 bytes |
| 記録 | |
| コンパイル時間 | 329 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 30,936 KB |
| 最終ジャッジ日時 | 2026-05-26 18:58:29 |
| 合計ジャッジ時間 | 5,176 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 3 |
ソースコード
import bisect
n, x = map(int, input().split())
a = [int(input()) for _ in range(n)]
b = [a[i]^x for i in range(n)]
b.sort()
ans = 0
for i in range(n):
ans += bisect.bisect_right(b, a[i]) - bisect.bisect_left(b, a[i])
ans //= 2
if x == 0:
ans -= n
print(ans)