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

建议使用的浏览器:

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

2217:Visit

题目描述
Wangye is interested in traveling. One day, he want to make a visit to some
different places in a line. There are N(1 <= N <= 2000) places located at points x1, x2, ..., xN (-100,000 ≤ xi ≤ 100,000). Wangye starts at HDU (x = 0), and he travels 1 distance unit in 1 minute . He want to know how many places he could visit at most, if he has T (1 <= T <= 200000 ) minutes.
输入解释
The input contains several test cases .Each test case starts with two number N and T which indicate the number of places and the time respectively. Then N lines follows, each line has a number xi indicate the position of i-th place.
输出解释
For each test case, you should print the number of places,Wangye could visit at most, in one line.
输入样例
5 16
-3
-7
1
10
8
输出样例
4
提示
In the sample, Wangye could visit (-3) first, then goes back to (0),  which costs him 6 minutes. 
Then he visits (1), (8), (10).  So he could visit 4 places at most in 16 minutes. :
来自杭电HDUOJ的附加信息
Author zjt
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2217

最后修改于 2020-10-25T22:51:33+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)