LINK:http://codeforces.com/contest/735/problem/C
题意:
有n个人比赛,比赛规则是淘汰制,而且一个人只能和和他比赛次数相差1以内的人比,问赢的人最多比了几场。
解法:
xjb搞
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n;
while(cin >> n) {
ll l = 1, r = 1, s = 2;
ll ans = 0;
while(s <= n) {
l = r, r = s, s = l + r;
ans++;
}
cout << ans << endl;
}
return 0;
}