QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 2048 MB 満点: 100

#2301. 喷气机旅行

統計

你那些富有的朋友总是喜欢吹嘘他们的旅行经历。每次见到他们,他们都会提到一些你从未听说过的异国他乡。他们都很乐意告诉你他们已经环游了世界——但你对此并不确定。这些环球旅行者真的完成了真正的环球航行吗?

关于究竟什么是环球航行,存在许多不同的定义。但就本题而言,我们将环球航行定义为:从同一点出发并回到该点,且在途中经过所有经线(经度线)。注意,北极和南极属于每一条经线。

图 J.1:样例输入 1 的示意图,展示了一次从雷克雅未克出发并回到该点的环球航行,途中经过了雅典、雅加达、火奴鲁鲁和芝加哥。

你的富友阿米莉亚(Amelia)给了你一份以航点列表形式记录的飞行日志。她的行程从第一个航点开始,按顺序访问其余航点,最后从最后一个航点返回第一个航点。在连续的两个航点之间,阿米莉亚总是沿着连接这两点的最短圆弧飞行。请判断阿米莉亚的行程是否可以被视为上述意义上的环球航行;如果不是,请找出一个阿米莉亚从未经过的经线。在这种情况下,请务必报告一个精确的整数或半整数经度值。

输入格式

输入包含: 一行一个整数 $n$ ($2 \le n \le 1\,000$),表示航点的数量。 $n$ 行,每行包含两个整数 $\phi$ 和 $\lambda$ ($-90 < \phi < 90, -180 \le \lambda < 180$),分别表示其中一个航点的纬度和经度。

航线中任意两个连续的航点既不重合,也不是球面上互为对跖点(相对点)的关系。

输出格式

如果该行程是一次有效的环球航行,输出 yes。否则,输出 no,并紧跟一个该行程从未经过的经度 $\lambda$ ($-180 \le \lambda < 180$)。该经度值必须以 .0.5 结尾。

样例

样例输入 1

5
64 -22
38 24
-6 107
21 -158
42 -88

样例输出 1

yes

样例输入 2

2
80 30
75 -150

样例输出 2

yes

样例输入 3

4
45 0
0 -170
-45 0
0 170

样例输出 3

no 173.5

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.