文件名称:liebao
介绍说明--下载内容均来自于网络,请自行研究使用
动物世界里猎豹的奔跑总是很让人有速度的美感。这天,猎豹盯上了一只野猪,现在
要捉住它,由于猎豹很好的保护色,所以野猪没发现猎豹。猎豹和野猪在同一条直线上,
他们的坐标分别是 x 和 y,x 是小于等于 y 的。
现在猎豹有两种跑法:
1跑动一格,就是从x到x+1或者x-1;
2跑动一倍,就是从x到2*x。
现在请你找出最少要几步捉到野猪。
★数据输入
输入第1行给出两个正整数x、y(0<x<=y<=100000),分别表示猎豹的坐标和野猪的坐标。
★数据输出
输出只有 1 行,给出最少步数。
输入示例
输出示例
5 17 4 -Animal world always makes a cheetah run with speed and beauty. That day, the cheetah eye on a wild boar, and now
To catch the color because the cheetah is well protected, so the boar did not find cheetah. Cheetah and wild boar in the same line,
Their coordinates are x and y, x is less than or equal y,.
Now there are two cheetah run method:
1 running a grid, that is, from x to x 1 or x-1
2 run double, that is, from x to 2* x.
Now find at least a few steps you catch wild boar.
★ data input
Line 1 input is given two positive integers x, y (0 <x <= y <= 100000), respectively, the coordinates of the cheetah and wild boar coordinates.
★ data output
Only one line of output, given the least number of steps.
Input Example
Example Output
5174
朗读
显示对应的拉丁字符的拼音
字典- 查看字典详细内容Google 翻译适合以下用途:搜索手机聊天商务关于 Google 翻译关闭即时翻译隐私权政策帮助
© 2010商务工具译者工具包关于 Google 翻译博客隐私权政策帮助
要捉住它,由于猎豹很好的保护色,所以野猪没发现猎豹。猎豹和野猪在同一条直线上,
他们的坐标分别是 x 和 y,x 是小于等于 y 的。
现在猎豹有两种跑法:
1跑动一格,就是从x到x+1或者x-1;
2跑动一倍,就是从x到2*x。
现在请你找出最少要几步捉到野猪。
★数据输入
输入第1行给出两个正整数x、y(0<x<=y<=100000),分别表示猎豹的坐标和野猪的坐标。
★数据输出
输出只有 1 行,给出最少步数。
输入示例
输出示例
5 17 4 -Animal world always makes a cheetah run with speed and beauty. That day, the cheetah eye on a wild boar, and now
To catch the color because the cheetah is well protected, so the boar did not find cheetah. Cheetah and wild boar in the same line,
Their coordinates are x and y, x is less than or equal y,.
Now there are two cheetah run method:
1 running a grid, that is, from x to x 1 or x-1
2 run double, that is, from x to 2* x.
Now find at least a few steps you catch wild boar.
★ data input
Line 1 input is given two positive integers x, y (0 <x <= y <= 100000), respectively, the coordinates of the cheetah and wild boar coordinates.
★ data output
Only one line of output, given the least number of steps.
Input Example
Example Output
5174
朗读
显示对应的拉丁字符的拼音
字典- 查看字典详细内容Google 翻译适合以下用途:搜索手机聊天商务关于 Google 翻译关闭即时翻译隐私权政策帮助
© 2010商务工具译者工具包关于 Google 翻译博客隐私权政策帮助
(系统自动生成,下载前可以参看下载内容)
下载文件列表
liebao.cpp