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

建议使用的浏览器:

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

5298:Solid Geometry Homework

题目描述
Yellowstar is studying solid geometry recently,and today’s homework is about the space,plane and sphere.So he draw many planes and spheres in the draft paper.These infinite planes and (the surface of)spheres divides the whole drawing space(which can be considered as a infinite 3D-space) into many disjoint regions.Planes and spheres forms the borders of these regions,and they don’t belong to any regions.
Then he comes up with a crazy idea:color the whole space with crayons.He wants that one region has only one color,and two adjacent regions should be colored differently (“adjacent” means the area of two regions’ common borders is greater than zero).Unfortunately,he has only two crayons:a yellow one and a red one.
Yellowstar likes yellow very much,so he gives some coordinates.The regions these points belong to should be colored yellow.
Given positions of all the planes and spheres and the coordinates mentioned above.You should determine:Is there a way to satisfy all the requests?Yellowstar also gives some other coordinates.He wants to know which color they will be while all the requests are satisfied.

输入解释
The first line contains an integer T,denoting the number of the test cases.
For each test case, the first line contains 4 integers m,n,p and q, denoting the number of planes,spheres,points and queries.
Then m lines follows,each containing four integers a,b,c and d,denoting the linear equation(ax+by+cz+d=0) of this plane.|a|+|b|+|c|>0.
Then n lines follows,each containing four integers x,y,z and r,denoting the center coordinate(x,y,z) and radius of this sphere.
Then p lines follows, each containing three integers x,y,z,denoting point(x,y,z),the region it belongs to should be colored yellow.
Next q lines are queries.Each contains three integers x,y,z-the coordinate of this point.You need to output which color it will be.

T<=30,0<=m<=100,0<=n<=10,0<=p<=200,1<=q<=2000,|all given numbers|<=10^6,any two planes or spheres aren’t coincidence.No point lies on given planes or spheres.
There is a blank line before each case.
输出解释
For each case,if there is no such a coloring way to color the whole space and meet all the requests,print“Impossible”.
Otherwise,for each query,print a line.If the color of this point can be certainly inferred,print it(’Y’ for yellow or ’R’ for red);if not(both are possible),print”Both”.
Print a blank line between adjacent cases.
输入样例
3

1 1 1 2
0 0 1 0
0 0 0 2
0 0 1
0 0 -1
0 0 4

1 1 2 1
0 0 1 0
0 0 0 2
0 0 1
0 0 -1
0 0 4

1 1 0 2
0 0 1 0
0 0 0 2
0 0 4
0 0 -1
输出样例
R
R

Impossible

Both
Both
来自杭电HDUOJ的附加信息
Author FZUACM
Recommend

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

源链接: HDU-5298

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

共提交 0

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