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

建议使用的浏览器:

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

7127:Kanade Doesn't Want to Learn CG

题目描述
Computational geometry and computer graphics are such hard parts of computer science that Kanade can't manage them. So she doesn't want to learn CG anymore. She goes to play basketball instead.

The only essential equipment in a basketball game is the ball and the hoop — a flat, rectangular backboard with a basket. We describe the hoop with a side view. Ignoring the thickness, the backboard is considered as a segment parallel to the $y$-axis, and the basket is considered as a segment parallel to the $x$-axis. The right end of the basket is connected to the backboard.

To simplify the model, we consider a basketball as a mass point. Taking only gravity into consideration, if we ignore the basket and the backboard, the trajectory of basketball will be a parabola $y=ax^2+bx+c$ with $a<0$. But the basketball is likely to hit the backboard, resulting in a change in trajectory. We consider the collision between a basketball and the backboard (including the endpoints) as a perfectly elastic collision, which means the velocity on the $x$-axis of the basketball will be reversed, and the velocity on the $y$-axis will remain the same. We ignore the court floor in this problem.

If the basketball passes through the basket (excluding the endpoints) from top to bottom, we consider the shoot is a goal. Once the basketball touches either of the endpoints of the basket, which means it hits the rim, the basketball will be bounced away and cannot make a goal. In addition, according to the rule, a basketball cannot pass through the basket from bottom to top, or it is a violation and cannot be counted as a goal.

Kanade knows the value of $a,b,c$ and the position of the backboard and basket. She would like to know whether the shoot will be a goal if the basketball starts from $x=-114514^{1919810}$ and moves in the positive direction of the $x$-axis.
输入解释
The first line of input contains one integer $T$ $(1\le T\le 500)$, indicating the number of test cases.

For each test case, the first line contains three integers $a,b,c\ (a \lt 0)$, indicating the parameters of the parabola.

The second line of each test case contains five integers $x_0,x_1,y_0,y_1,y_2$ $(x_0 \lt x_1,y_1 \lt y_0 \lt y_2)$, indicating that the two endpoints of the basket are $(x_0,y_0)$ and $(x_1,y_0)$, and the two endpoints of the backboard are $(x_1,y_1)$ and $(x_1,y_2)$.

It is guaranteed that the absolute value of all integers in the input won't exceed $10^4$.
输出解释
For each test case, if the shoot is a goal, output $\texttt{Yes}$ in a single line, otherwise output $\texttt{No}$ in a single line.
输入样例
4
-1 4 5
3 5 6 5 8
-2 -3 3
-1 0 2 1 4
-1 -9 19
8 10 6 5 8
-1 9 19
8 10 4 3 6
输出样例
Yes
Yes
No
No
来自杭电HDUOJ的附加信息
Hint The samples are shown as follows. Segment AB represents the basket, and segment CD represents the backboard.

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

源链接: HDU-7127

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

共提交 1

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