地址:http://codeforces.com/problemset/problem/712/C
题目:
代码:
#include <bits/stdc++.h> using namespace std; #define MP make_pair #define PB push_back typedef long long LL; typedef pair<int, int> PII; const double eps = 1e-8; const double pi = acos(-1.0); const int K = 1e6 + 7; int a[4]; int main(void) { int ans=0,st,se; cin>>st>>se; a[1]=a[2]=a[3]=se; while(1) { sort(a+1,a+1+3); if(a[1]<st) a[1]=min(a[2]+a[3]-1,st); else break; //printf("%d:%d %d %d ",ans+1,a[1],a[2],a[3]); ans++; } cout<<ans<<endl; return 0; }