CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 数值算法/人工智能 数据结构常用算法

文件名称:liebao

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    1.55kb
  • 已下载:
    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 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

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com