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

建议使用的浏览器:

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

4042:Fireworks

题目描述
2008 witnessed the magnificent opening ceremony of the 29th Beijing Olympic Games. The gorgeous fireworks shows during the ceremony have left deep impressions on millions of people all over the world.

Fireworks are always used to accompany many festivities. Today, in important events and festivities, fireworks are still guaranteed sights.

Recently, a new advanced device for generating fireworks is put into use. This device can precisely control the shapes and the positions and the colors of fireworks easily and arbitrarily. To use this device, we just need to set up its range of targets, as well as the appearances of fireworks. However, this kind of devices have a fatal flaw - if two or more devices have common part(s) in their ranges of targets, even just a point, it may cause some unpredictable errors, and finally result in unexpected appearances.

Now here comes your task: given the target ranges of two devices, please determine whether they have common part(s).

Note that the target range of a device will always be a none hole and none self-intersecting polygon on a plane, and the edges are considered as a part of the range. To simplify the problem, it’s guaranteed that interior angles of polygon will never be straight angles.
输入解释
The input contains multiple test cases, and the number of test cases is less than 50.
Each test case begins with two integers, m and n (3 <= m, n <= 500), indicating the numbers of the vertices of the ranges of two devices. Then m + n lines follow. Each line contains three float numbers (no more than 1000 in absolute value) indicating the coordinates of a point in 3D space. The first m points are the vertices of the range of the first device, and the other n points are the vertices of the range of the second device. The vertices of both polygonal ranges are given in clockwise order.

Two consecutive cases are separated by a blank line.

The input ends with m = 0 and n = 0
输出解释
For each test case, there should be a single line containing only one word "YES" or "NO" as the answer to the question: Are the ranges of two devices have common part(s)?
输入样例
4 3
3 3 0
7 8 0
8 7 0
10 0 0
5 3 -1
3 2 9
1 8 7

4 3
3 3 0
7 8 0
8 7 0
10 0 0
5 5 1
3 2 9
1 8 7

0 0
输出样例
YES
NO
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-4042

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

共提交 0

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