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

建议使用的浏览器:

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

4103:Clock

题目描述

There is only one Big Clock in the Alibaba’s headquarters on Mars. Since it is on Mars, the Clock is different as it was on Earth.
There are A hours per day and B minutes per hour. The Clock has two hands, the hour hand and the minute hand. The hour hand travels 360 degrees per day and the minute hand travels 360 degrees per hour. Both hands travel consecutively.
But for some reason, the Clock is not very steady. One day the Clock drops off the wall, but fortunately, it is still working. So they plans to put it back onto the wall. But they soon found a problem: it’s the only clock they have, so they don’t know the current time now. Clock only shows the relative position between the two hands, but doesn’t show how to place it (as there are no marks on it), so it can be rotated and represent several different times.
They want your help to determine how many different times the clock may represent.
输入解释
The input consists several testcases.
Every test case only contains one line with two integers A, B (1 <= A,B <= 109) and a real number θ (0 < θ < 2 π), means that there are A hours per day and B minutes per hour, and the minute hand is θ rad ahead of the hour hand)
Input ends with one line containing “0 0 0”.
输出解释
Print one integer, the number of different times the clock may represent.
输入样例
1 1 1.57
0 0 0
输出样例
0
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-4103

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

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)