시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 (추가 시간 없음) | 2048 MB | 49 | 31 | 30 | 63.830% |
You are given a circular maze such as the ones shown in the figures.
Determine if it can be solved, i.e., if there is a path which goes from the center to the outside of the maze which does not touch any wall. The maze is described by $n$ walls. Each wall can be either circular or straight.
Angles are measured in degrees; the angle $0$ corresponds to the upward pointing direction; and angles increase clockwise (hence the east direction corresponds to the angle $90$).
Each test contains multiple test cases. The first line contains an integer $t$ ($1 ≤ t ≤ 20$) — the number of test cases. The descriptions of the $t$ test cases follow.
The first line of each test case contains an integer $n$ ($1 ≤ n ≤ 5000$) — the number of walls.
Each of the following $n$ lines each contains a character (C
for circular, and S
for straight) and three integers:
It is guaranteed that circular walls do not overlap (but two circular walls may intersect at one or two points), and that straight walls do not overlap (but two straight walls may intersect at one point). However, circular and straight walls can intersect arbitrarily
For each test case, print YES
if the maze can be solved and NO
otherwise.
2 5 C 1 180 90 C 5 250 230 C 10 150 140 C 20 185 180 S 1 20 180 6 C 1 180 90 C 5 250 230 C 10 150 140 C 20 185 180 S 1 20 180 S 5 10 0
YES NO
Explanation of sample 1.
The two sample test cases correspond to the two mazes in the picture.
ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2021-2022 L번