2019-05-19
13:25:37
加油,加油,坚持,坚持!!!
一定要逆推,才可以是最少的次数
更好的方法:
https://www.cnblogs.com/ECJTUACM-873284962/p/6379014.html
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll x, y; scanf("%lld %lld", &x, &y); ll maxx = y; ll midd = y; ll minn = y; ll p = 0; ll q = 0; ll count = 0; while(1) { p = maxx; q = midd; maxx = midd + maxx - 1; midd = p; minn = q; count++; if (maxx >= x) { cout << count + 2 << endl; return 0; } } return 0; }