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

建议使用的浏览器:

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

4481:Slalom

题目描述
  You are competing in ski slalom, and you need to select an optimal path for the race to maximize the number of gates you can pass through.
  There are N gates in total, and the gates can be considered as points. If you pass the left or the right of one gate, this gate should not be considered as a gate that you passed through. The ith gate occurs at distance yi down the hill, with the horizontal position of the ith gate given by xi. Each gate is further down the hill than the previous gate (i.e. yi < yi+1 for all i).
  Your pairs of skis has speed vd (i.e. you move with a constant downward velocity of vd meters per second). Additionally, at any time you may move at a horizontal speed of at most vh meters per second.
You may start and finish at any two positions. Your task now is to calculate how many gates at most that you can pass through.
输入解释
  There is an integer T (1 <= T <= 1000) in the first line, which indicates there are T test cases in total.
  For each test case, there are three integers N (1 <= N <= 30000), vd (1 <= vd <= 10000) and vh (1 <= vh <= 10000) in the first line, which have the same meaning as above. The following N lines each contain two integers xi (1 <= xi <= 1000000) and yi (1 <= yi <= 1000000), the horizontal and vertical positions respectively of the ith gate.
   There are at most 10 test cases that satisfy N > 100.
输出解释
  For each test case, you should output the correct answer of the above task in one line.
输入样例
2
3 2 1
1 1
5 3
6 5
4 1 1
5 1
6 2
3 3
3 4
输出样例
2
3
提示
 For Sample 1, you can select to pass through gate 2 and gate 3 to maximize the number of gates you passed through.
    For Sample 2, you can select to pass through gate 1, gate 3 and gate 4 to maximize the number of gates you passed through.
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-4481

最后修改于 2020-10-25T23:13:56+00:00 由爬虫自动更新

共提交 0

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