結果
| 問題 | No.1072 A Nice XOR Pair |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-09 08:34:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 255 bytes |
| 記録 | |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 95,596 KB |
| 実行使用メモリ | 89,092 KB |
| 最終ジャッジ日時 | 2026-07-09 08:34:18 |
| 合計ジャッジ時間 | 2,955 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 3 |
ソースコード
from bisect import bisect_left,bisect_right
N,X = map(int,input().split())
A = sorted([int(input()) for _ in range(N)])
ans = 0
for i in range(N):
a = A[i]^X
ind1 = bisect_left(A,a)
ind2 = bisect_right(A,a)
ans += ind2 - ind1
print(ans//2)