#P16224. [蓝桥杯 2026 省 A] 均衡数

    ID: 18258 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>提交答案进制2026蓝桥杯省赛

[蓝桥杯 2026 省 A] 均衡数

Problem Description

If the binary representation (without leading 00) of a positive integer has the same number of 11's and 00's, then we call it a "balanced number".

Now, please find a balanced number xx that makes 2026202620262026x|2026202620262026 - x| as small as possible. If there are multiple balanced numbers with the same minimum value of 2026202620262026x|2026202620262026 - x|, choose the smallest one among them.

Output Format

This is an output-only fill-in-the-blank problem. You only need to compute the result and submit it. The answer to this problem is an integer. When submitting, only fill in this integer; any extra content will make you score 00.



Hint

Translated by ChatGPT 5