시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 3 | 3 | 3 | 100.000% |
You escaped the planet, but enemy starfighters are right behind you! To make things worse, in between you and the safety of your base is an asteroid field. The starfighters would never follow you into the asteroids, but unfortunately you used all your fuel in the escape, other than one small drop that will be enough for just one final burst of the engines. You’ve got two choices. You can surrender and face a long prison term. Or, you can aim your starship toward your base, and fire that one burst. There’s no way to know how fast that burst will make you move, but you know it’ll eventually get you to the safety of your base. That is, unless you collide with one of the asteroids.
You have a scan of the asteroid field, and need to determine whether you are sure to have a safe route through the field, or if surrender is the better option. Some important notes:
The first line of input consists of six real numbers $s_x$, $s_y$, $s_z$, $b_x$, $b_y$, $b_z$ and a single integer $n$, separated by spaces. These give the 3D coordinates of your ship ($s_x$, $s_y$, $s_z$), the 3D coordinates of the base ($b_x$, $b_y$, $b_z$), and the number of asteroids, $n$ ($0 ≤ n ≤ 30$).
The next $2n$ lines describe each of the asteroids, with one asteroid per pair of lines. The first line of each pair contains six real numbers $p_x$, $p_y$, $p_z$, $d_x$, $d_y$, $d_z$ and a single integer $m$, separated by spaces, giving the position ($p_x$, $p_y$, $p_z$) and direction ($d_x$, $d_y$, $d_z$) of the asteroid’s center of mass, as well as the number of points $m$ on the asteroid’s convex hull ($4 ≤ m ≤ 8$). The second line of each pair contains $3m$ real numbers, giving $m$ triples of points $c_{i,x}$, $c_{i,y}$, $c_{i,z}$, all separated by spaces. These are the 3D coordinates of the points on the convex hull of the asteroid, taken at the time of the scan. The asteroid center of mass is located somewhere within the convex hull (but not necessarily at the geometric center).
All real values in the input are in the range [$-2 \cdot 10^6$, $2 \cdot 10^6$] and have at most $6$ digits after the decimal point. Each asteroid’s direction is a unit vector, up to numerical tolerance, and will satisfy $\left| \sqrt{d_x^2 + d_y^2 + d_z^2} - 1 \right| ≤ 10^{-6}$.
If you are guaranteed to have a safe route through the asteroid field, then print Go
. Otherwise, print Surrender
.
10.0 0.0 0.0 0.0 0.0 0.0 1 5.0 3.0 0.0 0.0 -1.0 0.0 6 7.0 3.0 0.0 3.0 3.0 0.0 5.0 1.0 0.0 5.0 5.0 0.0 5.0 3.0 1.0 5.0 3.0 -1.0
Surrender
10.0 0.0 0.0 0.0 0.0 0.0 1 5.0 3.0 0.0 0.0 1.0 0.0 6 7.0 3.0 0.0 3.0 3.0 0.0 5.0 1.0 0.0 5.0 5.0 0.0 5.0 3.0 1.0 5.0 3.0 -1.0
Go
10.0 0.0 0.0 0.0 0.0 0.0 1 15.0 0.0 0.0 1.0 0.0 0.0 6 14.0 0.0 0.0 16.0 0.0 0.0 15.0 1.0 0.0 15.0 -1.0 0.0 15.0 0.0 1.0 15.0 0.0 -1.0
Go
ICPC > Regionals > North America > North America Qualification Contest > ICPC North America Qualifier 2021 B번