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

建议使用的浏览器:

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

6928:Fall Guys

题目描述
$\textit{Fall Guys}$ is a recently popular game. There are at most 60 players participating in a game and only one player will win finally after passing through one level after another.



$\textit{Fall Guys}$ has a level named climbing competition. Players will reach the destination after crossing many obstacles. After reaching the destination, they have to grab the crown to be the winner. But the crown moves up and down, and the player can catch it when the crown is below $h$ m.

Now, there are $n$ players participating in the climbing competition level. The height of the crown is $0$ at the beginning of the game, and then the crown will move up at a speed of $1$ m/s. When the height increases to $H$ m, the crown will immediately move down at a speed of $1$ m/s until the height decreases to $0$, and then move up and move down repeatedly.

The time that the $i$-th player reaches the destination is $x_i$. When a player reaches the destination, if the height of the crown is greater than $h$ m he will wait in place, otherwise he will immediately jump and grab the crown. However, each player has a delay time $c_i$ because of the bad network. Assuming that a player grab the crown at the moment of $t$ s, the system will determine that the moment he grab the crown is $(t+c_i)$ s.

The first player who grab the crown will win. If multiple players grab the crown at the same time, the winner is the player with the lower number.

You are given the arrival time $x_i$ and the delay time $c_i$ of all players, please calculate who will be the final winner.
输入解释
The input consists of multiple test cases. The first line contains an integer $T$ $(1 \leq T \leq 20)$ — the number of test cases. The description of the test cases follows.

The first line contains three integers $n,h,H$ $(1 \leq n \leq 2*10^5,1 \leq h \leq H \leq 300)$.

The second line contains $n$ integers $x_1,x_2,\dots,x_n(1 \leq x_i \leq 2*10^5)$ — the arrival time of the $i$-th player.

The third line contains $n$ integers $c_1,c_2,\dots,c_n(1 \leq c_i \leq 2*10^5)$ — the delay time of the $i$-th player.
输出解释
For each test case, print the number of the final winner.
输入样例
2
4 2 5
3 6 1 9
6 4 2 3
3 1 2 
1 2 3
4 5 6
输出样例
3
1
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6928

最后修改于 2021-06-22T18:18:55+00:00 由爬虫自动更新

共提交 0

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