文件名称:zhuiyezhu
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.28kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
动物世界里猎豹的奔跑总是很让人有速度的美感。这天,猎豹盯上了一只野猪,现在
要捉住它,由于猎豹很好的保护色,所以野猪没发现猎豹。猎豹和野猪在同一条直线上,
他们的坐标分别是 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.
Running twice, 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
5 17 4
要捉住它,由于猎豹很好的保护色,所以野猪没发现猎豹。猎豹和野猪在同一条直线上,
他们的坐标分别是 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.
Running twice, 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
5 17 4
(系统自动生成,下载前可以参看下载内容)
下载文件列表
liebao and yezhu.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.