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

建议使用的浏览器:

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

3862:The Lost Traveler

题目描述
Bob is a robot who lives in a two-dimensional world. One day, he decided to go out for a travel. There are two kinds of traveling ways for Bob: to walk forward, and to rotate. When he searched the path with his iPhone 4, he only downloaded part of the data because of the bad signal. The data just indicated a series of directions for rotation. Bob decided to go on his trip according to this data.

Bob got started at the center of the two-dimensional world (at least he thought he did), and began to move forward. He can walk far enough (but he can't stay at the same place, even in starting point) and then stop to rotate according to the data. The paths can get intersected.

However, Bob didn't know whether he could get back home or not. So he turned to you for help.

For example, the data indicates like this:
Move forward (He must move for a distance greater than zero. He must not stay and make the next turning without moving forward. The same goes for the following.)
Turn 120 degrees anti-clockwise
Move forward
Turn 120 degrees clockwise
Move forward
Turn 120 degrees clockwise
Move forward
  
Bob could walk like the figure shows, and he'll get back home.
输入解释
The first line of the input gives the number of test cases, T. T est cases follow.
  
Each test case begins with a line containing an integer N,representing the number of degrees. N degrees follow.0<N<100000
  
Each line contains a number D with a precision of two decimal places, positive for clockwise, negative for anti-clockwise. (-360.00 <= D <= 360.00)
输出解释
For each case, output one line. If bob can go back to start point, print "Yes". Otherwise, print "No".
输入样例
2
3
-120.00
120.00
120.00
2
120.00
-120.00
输出样例
Yes
No
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-3862

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

共提交 0

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