CF690A2.Collective Mindsets (medium)
提高+/省选-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Way to go! Heidi now knows how many brains there must be for her to get one. But throwing herself in the midst of a clutch of hungry zombies is quite a risky endeavor. Hence Heidi wonders: what is the smallest number of brains that must be in the chest for her to get out at all (possibly empty-handed, but alive)?
The brain dinner night will evolve just as in the previous subtask: the same crowd is present, the N - 1 zombies have the exact same mindset as before and Heidi is to make the first proposal, which must be accepted by at least half of the attendees for her to survive.
太棒了!海蒂现在知道了,保险箱里至少需要多少颗大脑,她才能分到一颗。但贸然闯入一群饥饿僵尸的包围圈,风险实在太大。因此海蒂不禁思索:保险箱中至少需要放置多少颗大脑,才能确保她最终得以全身而退(哪怕空手而归,但必须活着)?
“大脑盛宴之夜”的流程与上一子任务完全相同:出席者阵容不变,N−1 名僵尸的心理状态也与之前完全一致,而海蒂需首先提出分配方案;该方案必须获得至少半数出席者的赞成,她才能幸存。
输入格式
The only line of input contains one integer: N, the number of attendees (1 ≤ N ≤ 109).
输入仅包含一行,其中有一个整数:N,表示与会人数(1 ≤ N ≤ 10⁹)。
输出格式
Output one integer: the smallest number of brains in the chest which allows Heidi to merely survive.
输出一个整数:宝箱中能让海蒂勉强存活的最少大脑数量。
输入输出样例
输入#1
1
输出#1
0
输入#2
3
输出#2
1
输入#3
99
输出#3
49
输入解题思路,AI测评打分。不知道怎么写?