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

建议使用的浏览器:

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

7052:Smzzl with Safe Zone

题目描述
A boy, whose ID is smzzl, is playing a game named Zig-Zag-Land(ZZL). This is a 2D battle royale game. When the game starts, you will spawn in a random place in the map, and your target is to move into the safe zone.

Given the border of the map and the border of the safe zone, he wants to know the shortest distance between the spawn point and the safe zone in the worst case.

It can be proved that the square of the answer is always rational. In order to check your answer precisely, you need to print the square of your answer modulo $10^9+7$. You may find the way to modulo a rational number in Problem 1006.
输入解释
The input consists of multiple test cases.

The first line contains an integer $T$ ($1 \leq T \leq 10^4$) -- the number of test cases.

For each test case:

In the first line, there is an integer $m$ ($3 \leq m \leq 10^5$), which is the number of vertexes of the safe zone.

In the next $m$ lines, each line contains two integers $x_i,y_i$ ($|x_i|,|y_i| \leq 10^7$), which is a vertex of the safe zone.

In the next line, there is an integer $n$ ($3 \leq n \leq 10^5$), which is the number of vertexes of the game map.

In the next $n$ lines, each line contains two integers $x_i,y_i$ ($|x_i|,|y_i| \leq 10^7$), which is a vertex of the game map.

It is guaranteed that:
- The safe zone is a subset of game map.
- The safe zone and the game map are both convex polygons.
- All vertexes are given in counter-clockwise order.
- The sum of $n$ over all test cases will not exceed $10^6$.
- The sum of $m$ over all test cases will not exceed $10^6$.

You may need to use faster input method.
输出解释
For each test case, output the square of your answer modulo $10^9+7$.
输入样例
1
4
0 0
1 0
1 1
0 1
4
-1 -1
2 -1
2 2
-1 2
输出样例
2

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

源链接: HDU-7052

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

共提交 1

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