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

建议使用的浏览器:

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

5408:CRB and Farm

Special Judge 特殊评判
题目描述
CRB has a farm. His farm has a shape of convex polygon. There are $K$ barns in the farm. All of them are strictly inside the polygon. CRB wants to build a fence enclosing all the barns. He prepared $2K$ posts and steel strips of exactly the same length with the perimeter of his farm. A post can only be placed on the vertex of the polygon(farm), and steel strips must enclose all posts. Now, CRB wonders whether he can build a fence with currently available resources or not. Can you help him?
输入解释
There are multiple test cases. The first line of input contains an integer $T$, indicating the number of test cases. For each test case:
The first line contains an integer $N$ – the number of vertices of the convex polygon(the shape of CRB‘s farm).
Then $N$ lines follow, $i$-th line containing two integers $x$ and $y$, the coordinates of $i$-th vertex. The vertices are given in counter-clockwise order.
The first line contains an integer $K$ – the number of barns.
Each of the next $K$ lines contains two integers $x$ and $y$, the coordinates of the barn.
1 ≤ $T$ ≤ 9
3 ≤ $N$, $K$ ≤ 2 * $10^{5}$
$-10^{9}$ ≤ $x$, $y$ ≤ $10^{9}$
All points(including farm vertices and barns) are pairwise different.
It is guaranteed that the barns never all lie on a line.

输出解释
For each test case, output “Yes” if it is possible to build a fence, otherwise output “No”.
If possible, output a solution in the following format:
On the first line, output an integer $M$ - the number of posts used to build a fence.
On the next line, you should output the indices of the vertices(1-based) where you place posts in increasing order.
Your solution will be accepted if $M$ ≤ $2K$ and the length of the fence is not longer than the perimeter of the farm. Also, the barns must be strictly inside the fence.
输入样例
1
5
0 1
3 0
4 2
2 3
0 3
3	
2 1
3 1
3 2
输出样例
Yes
4
1 2 3 4
来自杭电HDUOJ的附加信息
Author KUT(DPRK)
Recommend wange2014

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

源链接: HDU-5408

最后修改于 2020-10-25T23:22:25+00:00 由爬虫自动更新

共提交 0

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