RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 ICPC00131

L. Circular Maze

설명

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. • Circular walls are described by a radius \(r\), the distance from the center, and two angles θ_{1}, θ_{2} describing the beginning and the end of the wall in the clockwise direction. Notice that swapping the two angles changes the wall. • Straight walls are described by an angle θ, the direction of the wall, and two radii \(r_{1} < r_{2}\) describing the beginning and the end of the wall. 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 \le t \le 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 \le n \le 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: • either r, θ_{1}, θ_{2} (\(1 \le r \le 20\) and 0 ≤θ_{1}, θ_{2} < 360 with θ_{1}̸ = θ_{2}) if the wall is circular, • or \(r_{1}\), \(r_{2}\) and θ (\(1 \le r_{1} < r_{2} \le 20\) and 0 ≤θ < 360) if the wall is straight. 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. Problem L: Circular Maze SWERC \(2021-2022\)

출력 형식

For each test case, print YES if the maze can be solved and NO otherwise.

예제 1
입력
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
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC SWERC 2021

평가 및 의견

L. Circular Maze

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

L. Circular Maze

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8