当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6807:Fake Photo

Special Judge 特殊评判
题目描述
Zhang3 has made a fake photo by Photoshop, and published it on the Internet.

However, there are $n$ watches in the photo, showing different times. We assume that every watch has two hands: the hour hand and the minute hand, both moves at a uniform speed.

Someone pointed out the problem of the watches. Then everyone began to doubt that it's a fake photo. To respond, Zhang3 will announce that the photo is taken at time $x$, which is a time in a day. By choosing $x$ perfectly, she can make all of the watches look like showing time $x$, with a small error. For example, if there are two watches showing $\text{12:30:00}$ and $\text{02:40:00}$ respectively, she can choose $x = \text{01:35:00}$ as if both watches are showing time $x$.

Specifically, we define the error of a hand of a watch as the angle between its actual location and its ideal location, where the ideal location is the correct location to show time $x$. In the example above, the first watch shows $\text{12:30:00}$ and $x = \text{01:35:00}$, so the minute hand has an error of $30^\circ$ while the error of the hour hand is a little bit larger.

Please help Zhang3 choose such $x$ that the maximum error among all of the $2n$ hands is minimized. $x$ doesn't need to be an integer in seconds. Print the optimal error in degrees.
输入解释
The first line of the input gives the number of test cases $T \; (1 \le T \le 100)$. $T$ test cases follow.

For each test case, the first line contains an integer $n \; (1 \le n \le 5 \times 10^4)$, the number of watches.

Then $n$ lines follow, the $i^\mathrm{th}$ of which contains a string of format $\text{HH:MM:SS} \; (0 \le \text{HH} \le 23, 0 \le \text{MM, SS} \le 59)$, describing the time the $i^\mathrm{th}$ watch is showing.

The sum of $n$ in all test cases doesn't exceed $10^5$.
输出解释
For each test case, print a line with a real number $\alpha \; (0 \le \alpha \le 180)$, representing the answer is $\alpha ^\circ$.

Your answers should have absolute or relative errors of at most $10^{-6}$.
输入样例
2
2
12:30:00
02:40:00
3
00:00:00
23:59:59
06:30:30
输出样例
32.5
91.55
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6807

最后修改于 2020-10-25T23:34:33+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 524288/524288K(Java/Others)