文章目录

  • 一、Bear and Big Brother
  • 总结

一、Bear and Big Brother

本题链接:Bear and Big Brother

题目

A. Bear and Big Brother
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
Bear Limak wants to become the largest of bears, or at least to become larger than his brother Bob.

Right now, Limak and Bob weigh a and b respectively. It’s guaranteed that Limak’s weight is smaller than or equal to his brother’s weight.

Limak eats a lot and his weight is tripled after every year, while Bob’s weight is doubled after every year.

After how many full years will Limak become strictly larger (strictly heavier) than Bob?

Input
The only line of the input contains two integers a and b (1 ≤ a ≤ b ≤ 10) — the weight of Limak and the weight of Bob respectively.

Output
Print one integer, denoting the integer number of years after which Limak will become strictly larger than Bob.

Examples

input
4 7
output
2

input
4 9
output
3

input
1 1
output
1

Note
In the first sample, Limak weighs 4 and Bob weighs 7 initially. After one year their weights are 4·3 = 12 and 7·2 = 14 respectively (one weight is tripled while the other one is doubled). Limak isn’t larger than Bob yet. After the second year weights are 36 and 28, so the first weight is greater than the second one. Limak became larger than Bob after two years so you should print 2.

In the second sample, Limak’s and Bob’s weights in next years are: 12 and 18, then 36 and 36, and finally 108 and 72 (after three years). The answer is 3. Remember that Limak wants to be larger than Bob and he won’t be satisfied with equal weights.

In the third sample, Limak becomes larger than Bob after the first year. Their weights will be 3 and 2 then.

本博客给出本题截图


题意:两个数,一个数每次扩大3倍,另一个数每次扩大2倍,问第一个数什么时候比第二个数大
AC代码

#include <iostream>using namespace std;int main()
{int a, b, i;cin >> a >> b;for (i = 0; a <= b; i ++ )a *= 3, b *= 2;cout << i << endl;return 0;
}

总结

水题,不解释

Bear and Big Brother相关推荐

  1. Codeforces A. Bear and Big Brother

    ...不行.这题之后.不做1000分以下的了.很耻辱 A. Bear and Big Brother time limit per test 1 second memory limit per tes ...

  2. CF - 791A. Bear and Big Brother - 模拟

    1.题目描述: A. Bear and Big Brother time limit per test 1 second memory limit per test 256 megabytes inp ...

  3. Codeforces——791A Bear and Big Brother

    小声BB 又开始更新了,最近打游戏王DL,这个栏目会留一些上分的心得. 题干 time limit per test:1 second memory limit per test:256 megaby ...

  4. A. Bear and Big Brother

    还是水题,上代码 #include <cstdio> #include <cstring> #include <algorithm> #include <bi ...

  5. Codeforces Bear and Big Brother

    题目链接 题目意思 现在有两头熊,分别为熊大,熊二.他们的体重分别为a,b,其中a<=b.熊大每年体重增加三倍,熊二每年体重增加两倍.现在问过几年熊大的体重比熊二重. 解题思路 这就是一道简单的 ...

  6. CF791A Bear and Big Brother 【题解】

    来一篇O(1)O(1)O(1)的题解 题目可以转化为求最小的xxx使得下式成立. a∗3x>b∗2xa*3^x>b*2^xa∗3x>b∗2x 继续转化 3x2x>ba\frac ...

  7. 【codeforces 791A】Bear and Big Brother

    [题目链接]:http://codeforces.com/contest/791/problem/A [题意] 给你两个数字a和b; a每次乘3,b每次乘2 问你什么时候a第一次大于b [题解] 傻逼 ...

  8. Codeforces上通过数超过5W人的题

    Codeforces上通过数超过5W人的题 共32题:1000分4题,800分28题. 编号 题号 题名 分数 通过数 1 4A Watermelon 800 x193501 2 71A Way To ...

  9. Code Forces Bear and Forgotten Tree 3 639B

    B. Bear and Forgotten Tree 3 time limit per test2 seconds memory limit per test256 megabytes inputst ...

最新文章

  1. 5G时代下,边缘计算产品的未来展望
  2. 吃透这套架构体系,三年成为架构师!
  3. QTime使用中遇到的”not enough actual parameters for macro 'min'“问题
  4. randn--创建正态分布随机矩阵
  5. Android开发中遇到的问题(二)——新建android工程的时候eclipse没有生成MainActivity和layout布局...
  6. 线程同步之关键代码段
  7. html页面获取关闭页面事件,html页面关闭事件
  8. mysql f_MySQL
  9. suse linux增加新磁盘分区,Virtualbox中Linux添加新磁盘并创建分区
  10. oracle byte 转string,C# 中 byte 转化成string
  11. 用 Windows Media Center 免费看大片 (二)
  12. c1200 写频软件_摩托罗拉C1200写频软件
  13. 影视后期PR效果窗口
  14. 机器学习之回归与分类
  15. pathon学习日记
  16. Auto.js 简单 悬浮移动
  17. 常见的变换总结与代码:DCT,STFT,K-L变换等
  18. Android 开发第七弹:简易时钟(秒表)
  19. 如何下载唐山市卫星地图高清版大图
  20. 微信支付开发(9) 标记客户投诉处理状态

热门文章

  1. 从零开始的微信小程序入门教程
  2. php博客系统 加载评论,Yii实现单用户博客系统文章详情页插入评论表单的方法...
  3. win7ie11调用java失败,win7纯净版系统下ie11无法加载java插件
  4. usb接口驱动_UART串行总线舵机转接板规格、接线说明 amp; 驱动安装
  5. 百度云管家使用QQ第三方登录时提示“由于网络原因无法载入页面 请点击刷新后重试”
  6. Unity UGUI图集专题
  7. 人身三流指什么_关于《三流人生》那些事儿
  8. MySQL运维进阶必备
  9. 百度地图获取本地搜索(LocalSearch)全部结果并显示标注
  10. matlab绘制动画保存