Codeforces #382 C Tennis Championship

里约热内卢举办了一场网球锦标赛,采用淘汰赛规则。题目要求找出冠军最多能参加多少场比赛。已知两名选手之间的比赛,必须满足一方已赛次数与另一方相差不超过1。输入为参赛人数n(2≤n≤10^18),输出冠军最多能参加的比赛数。例如,当n=2时,答案为1;n=3时,答案为2;n=4时,答案为2,因为冠军最多只能与2名选手比赛,之后无法满足比赛规则。
摘要由CSDN通过智能技术生成
C. Tennis Championship
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participating, and the tournament will follow knockout rules from the very first game. That means, that if someone loses a game he leaves the tournament immediately.

Organizers are still arranging tournament grid (i.e. the order games will happen and who is going to play with whom) but they have already fixed one rule: two players can play against each other only if the number of games one of them has already played differs by no more than one from the number of games the other one has already played. Of course, both players had to win all their games in order to continue participating in the tournament.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值