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

建议使用的浏览器:

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

6941:Car

题目描述
HZ is driving a car along a straight road of length $L$. Now the car is at one end of the road, and HZ wants to go to the other end.

There are $N$ speed measuring points on the road. The distance between the start point and the $i$-th speed measuring point is $S_i$. The speed limit of the $i$-th speed measuring point is $V_i$, which means that when the car passes the point, its velocity should not exceed $V_i$.

The initial velocity of the car is zero, and the car must ${\bf stop}$ at the other end. The absolute value of acceleration of the car can not exceed $A$.

HZ wants you to calculate the shortest time to go to the other end of the road, but Zayin thinks it's too easy. Therefore, they come up with new problems for you.

Initially, there is no speed measuring point on the road. Then, the $N$ speed measuring points will be built one by one in order from $1$ to $N$. After each one is built, you need to answer whether the shortest time becomes longer or not.
输入解释
There are multiple test cases.

For each test case, the first line contains $3$ integers $L$, $A$ and $N$ $(1\leq L \leq 10^5,~ 1\leq A \leq 9,~ 1\leq N \leq 10^5)$.

In the next $n$ lines, each line contains $2$ integers $S_i$ and $V_i$ $(0\leq S_i \leq L,~ 1 \leq V_i \leq 10^3)$, denoting a speed measuring point. And they will be built in order of input.

It's guaranteed that the sum of $N$ of all the test cases is not larger than $2 \cdot 10^5$.
输出解释
For each test case, print $N$ lines.

In the $i$-th line of each test case, if the shortest time becomes longer after building the $i$-th one, print $1$. Otherwise, print $0$.
输入样例
6 2 5
2 1
4 1
3 3
1 1
1 1
输出样例
1
1
0
1
0

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

源链接: HDU-6941

最后修改于 2021-10-23T19:10:45+00:00 由爬虫自动更新

共提交 0

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