1.题目描述:
Limak 想在体重上超过 Bob,Limak 以每年3倍体重增长,Bob 以每年2倍增长,问你至少多少年 Limak 可以超过Bob。
3.解题思路与:
直接模拟就好了
4.AC代码:
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
#define maxn 100100
#define N 1111
#define eps 1e-6
#define pi acos(-1.0)
#define e exp(1.0)
using namespace std;
const int mod = 1e9 + 7;
typedef long long ll;
typedef unsigned long long ull;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
long _begin_time = clock();
#endif
int a, b;
while (~scanf("%d%d", &a, &b))
{
int ans = 0;
while (a <= b)
{
ans++;
a *= 3;
b *= 2;
}
printf("%d\n", ans);
}
#ifndef ONLINE_JUDGE
long _end_time = clock();
printf("time = %ld ms.", _end_time - _begin_time);
#endif
return 0;
}