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

建议使用的浏览器:

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

5488:Shape

题目描述
As we know, a new pentagon shape was found recently that can tile in a plane.

As we can see in the picture, several pentagons form a small unit, which is the minimal repeat unit. And only with translation, we can use these units to cover the whole plane without any gap. However, it is hard to find a new pentagon and its corresponding repeat unit. That’s why the $15^{th}$ pentagon shape was found with the help of computer. We can see how complex it is that it almost cannot be worked out manually.
In this problem, you are going to do a much easier task. You have to write a program to judge whether a given polygon can cover a plane just by translation. You don’t have to handle rotation, symmetry and any other operations, just translation. And you only need to give out your judgment.
输入解释
The first line of input contains a number $T$ indicating the number of test cases ($T≤50$).
For each test, the first line contains an integer $N$, which indicates the number of the nodes ($3≤N≤20$). And the following $N$ lines give the coordinates $Xi$ and $Yi$ of each node $i$. All the coordinates are integer and the absolute value of each coordinate will not exceed 20. It is guaranteed that the input is a legal polygon, and three consecutive points would not be collinear.
输出解释
For each test case, output a single line consisting of “Case #X: ” first. $X$ is the test case number starting from 1. Output “Yes” if the given polygon can tile in a plane, or “No” otherwise.
输入样例
2
4
0 0
0 1
1 1
1 0
5
0 0
1 1
1 2
0 2
-1 1
输出样例
Case #1: Yes
Case #2: No
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5488

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

共提交 0

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