麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

【Codeforces 735 C Tennis Championship】+ 貪心

2019-11-14 09:15:10
字體:
供稿:網(wǎng)友

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.

Tournament hasn’t started yet so the audience is a bit bored. Ostap decided to find out what is the maximum number of games the winner of the tournament can take part in (assuming the rule above is used). However, it is unlikely he can deal with this PRoblem without your help. Input

The only line of the input contains a single integer n (2?≤?n?≤?1018) — the number of players to participate in the tournament. Output

Print the maximum number of games in which the winner of the tournament can take part. Examples Input

2

Output

1

Input

3

Output

2

Input

4

Output

2

Input

10

Output

4

Note

In all samples we consider that player number 1 is the winner.

In the first sample, there would be only one game so the answer is 1.

In the second sample, player 1 can consequently beat players 2 and 3.

In the third sample, player 1 can’t play with each other player as after he plays with players 2 and 3 he can’t play against player 4, as he has 0 games played, while player 1 already played 2. Thus, the answer is 2 and to achieve we make pairs (1,?2) and (3,?4) and then clash the winners.

得分為n的人與得分為n - 1的比賽才能使比賽次數(shù)最大化,多少人才能出一個得分為N的人呢?

AC代碼:

#include<cstdio>typedef long long LL;int main(){ LL N,l = 1, r = 1,num = 0,t; scanf("%lld",&N); while(l + r <= N) t = l,l = r,r = t + r,num++; printf("%lld/n",num); return 0;}
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 久久超碰99 | 精品国产一区二区三 | 欧美一级毛片美99毛片 | 日本大片在线播放 | 中文字幕一区在线观看视频 | 亚洲国产高清视频 | 久久亚洲国产午夜精品理论片 | 深夜免费视频 | 久久久久久久久日本理论电影 | 精品一区二区电影 | 欧美乱淫| 福利在线小视频 | 中文字幕精品在线播放 | 欧美日韩成人一区二区 | 欧美一a一片一级一片 | 亚洲精中文字幕二区三区 | 久久99精品久久久久久园产越南 | 日韩视频高清 | 99精品无人区乱码在线观看 | 久久男人的天堂 | 久久毛片免费观看 | 欧美日韩亚州综合 | 爱视频福利 | 久章草在线视频 | 亚洲成人在线免费 | 国产日韩在线观看一区 | 日韩区在线 | 激情视频在线播放 | 国产高潮好爽好大受不了了 | 一本色道久久综合狠狠躁篇适合什么人看 | 国产激情精品一区二区三区 | 精品亚洲视频在线观看 | 国产午夜精品一区二区三区免费 | 小视频成人 | 午夜视频在线免费观看 | 久久国产精品一区 | 欧美城网站地址 | 久久毛片 | 成人店女老板视频在线看 | 国产精品久久久久久久不卡 | av国产片|