当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2590:Steps

题目描述
One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the previous step.
What is the minimum number of steps in order to get from x to y? The length of the first and the last step must be 1.
输入解释
Input consists of a line containing n, the number of test cases.
输出解释
For each test case, a line follows with two integers: 0 <= x <= y < 2^31. For each test case, print a line giving the minimum number of steps to get from x to y.
输入样例
3
45 48
45 49
45 50
输出样例
3
3
4

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2590

最后修改于 2020-10-29T06:36:33+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536