球CF D题面

灌水区

同求
by rsg23 @ 2022-01-17 00:03:50


$Cu$ 虽然我应该不会
by Jerrlee✅ @ 2022-01-17 00:04:35


cu ball
by zzzYheng @ 2022-01-17 00:04:39


``` Monocarp is planning to host a martial arts tournament. There will be three divisions based on weight: lightweight, middleweight and heavyweight. The winner of each division will be determined by a single elimination system.In particular, that implies that the number of participants in each division should be a power of two. Additionally, each division should have a non-zero amount of participants.$n$ participants have registered for the tournament so far, the $i$-th of them weighs $a_i$. To split participants into divisions, Monocarp is going to establish two integer weight boundaries $x$ and $y$ ($x < y$). All participants who weigh strictly less than $x$ will be considered lightweight. All participants who weigh greater or equal to $y$ will be considered heavyweight. The remaining participants will be considered middleweight.It's possible that the distribution doesn't make the number of participants in each division a power of two. It can also lead to empty divisions. To fix the issues, Monocarp can invite an arbitrary number of participants to each division.Note that Monocarp can't kick out any of the $n$ participants who have already registered for the tournament.However, he wants to invite as little extra participants as possible. Help Monocarp to choose $x$ and $y$ in such a way that the total amount of extra participants required is as small as possible. Output that amount. ```
by Eason_AC @ 2022-01-17 00:05:33


这玩意直接发会被认作是未按要求排版,吐了
by Eason_AC @ 2022-01-17 00:05:56


@[zhicheng](/user/393934) @[rsg23](/user/384498) @[Jerrlee✅](/user/367652) @[zzzYheng](/user/463210)
by Eason_AC @ 2022-01-17 00:06:17


Sample Input: ``` 4 4 3 1 2 1 1 1 6 2 2 2 1 1 1 8 6 3 6 3 6 3 6 6 ``` Sample Output: ``` 0 2 3 2 ```
by Eason_AC @ 2022-01-17 00:06:43


这东西是代码?/jk
by Jerrlee✅ @ 2022-01-17 00:07:17


它不给发……
by Jerrlee✅ @ 2022-01-17 00:07:29


@[Eason_AC](/user/112917) 谢谢你!
by zhicheng @ 2022-01-17 00:07:44


| 下一页