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

建议使用的浏览器:

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

7112:Start Dash ! !

题目描述
It's time to start dash!!

As a LLer, Kris loves dashing and he wants everyone to enjoy the interest of dashing. Kris can dash towards someone and pick him up so that they will dash together, forming a ray. If Kris hits the wall after he picks someone up, they will both enjoy the interest of dashing. For some secret reason, the walls now form a convex hull and Kris can only start dashing form an arbitary point in a triangle outside the polygon. Now Kris wants you to calculate the area of points that he can enjoy dashing with.

Formally, there's a convex hull. You will be given $m$ queries. Each query will give you a triangle $A$ ( maybe degenerated ), which is strictly outside the polygon. You must answer the area of points which satisfy the condition:

1.The point is strictly outside the polygon.

2. There exists a point $P$ in the triangle, the ray from $P$ to this point intersects with the convex hull but the segment from $P$ to this point does not.
输入解释
This problem contains multiple test cases.

The first line contains an intger $T$ indicates the number of test cases.

For each test case, the frist line contains one intger $n$ ($3 \leq n \leq 10^5$) indicating the number of points in the convex hull.

The next $n$ lines each contains two integers $x_i,y_i$ ($0 \leq |x_i|,|y_i| \leq 10^6$) which means the coordinate of the $i_{th}$ point.

It's garanteed that the points will be given in the order to form the polygon and in counter-clockwise.

Then you will be given an integer $q$ ($1 \leq q \leq 10^5$) indicating the number of queries.

The next $q$ lines each contains six integers $x_1,y_1,x_2,y_2,x_3,y_3$ ($0 \leq |x|,|y| \leq 10^6$) which means the coordinates of the points of the triangle.

It's guaranteed that the sum of $n$ is no more than $6 \times 10^5$.
输出解释
For each query, print the answer $2 \times S$ in one line. $S$ indicates the area of points meets the condition.

It can be proved that $2 \times S$ is always an integer.
输入样例
1
8
-1 2
-2 1
-2 -1
-1 -2
1 -2
2 -1
2 1
1 2
1
0 3 0 4 1 5
输出样例
11

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

源链接: HDU-7112

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 524288/524288K(Java/Others)