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

J. Jet Set

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

Your wealthy friends love to brag about all their travelling. Every time you see them, they have visited some new exotic place you have never heard of. All of them are all too happy to tell you they have been all around the world—but you're not so sure about that. Have these jetsetters made a real circumnavigation?

There exist many different definitions of what exactly constitutes a circumnavigation, but for the purposes of this problem we consider a circumnavigation a journey starting and ending at the same point and visiting all meridians (lines of longitude) along the way. Note that the North and South Pole are part of every meridian.

Amelia, one of your rich friends, gave you a log of her flights in the form of a list of waypoints. Her trip started at the first waypoint, visited the remaining waypoints in order, and finally went back from the last waypoint to the first. Between consecutive waypoints, Amelia always travelled along the shortest circular arc connecting the two points. Find out whether Amelia's trip can be considered a circumnavigation in the above sense, and if not find a meridian that Amelia never visited. In that case, always report exactly an integer-valued or half-integer-valued meridian.

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(2 \le n \le 1\,000\)), the number of waypoints.
- \(n\) lines, each with two integers \(\phi\) and \(\lambda\) ($-90 < \phi
< 90, -180 \le \lambda < 180$), the latitude and longitude of one of the waypoints.

No two consecutive waypoints along the route are equal or antipodes (opposite points on the sphere) of each other.

출력 형식

If the route is a valid circumnavigation, output yes. Otherwise, output no, followed by a longitude \(\lambda\) (\(-180 \le \lambda < 180\)) which the route never visited. The longitude must end in either .0 or .5.

예제 1
입력
5
64 -22
38 24
-6 107
21 -158
42 -88
출력
yes
예제 2
입력
2
80 30
75 -150
출력
yes
예제 3
입력
4
45 0
0 -170
-45 0
0 170
출력
no 173.5
문제 정보

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

출처 ICPC NWERC 2021

평가 및 의견

J. Jet Set

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

Log in to rate problems.

개별 의견

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

풀이 제출

J. Jet Set

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