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

建议使用的浏览器:

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

4084:The Voyages of Zheng He

题目描述


Zheng He (1371–1433) was a Hui-Chinese mariner, explorer, diplomat and fle et admiral, who commanded seven voyages to Southeast Asia, South Asia, the Middle East, and East Africa, collectively referred to as the Voyages of Zheng He.
His fle et was by far the largest and most advanced fleet in the world at his time, and his voyages were about 80 years earlier than Columbus' America discovering voyage.
Recently some Chinese ACMers just found an old document about Zheng He's Voyage. It said:
Once upon a time, when Zheng He was sailing along the Malaysia coast, a strange volcano suddenly erupted.The volcano threw some strange hot rocks on the sea. Those rocks floated on the water at first, and after some time, when water went into their center, they would explode. Every rock could be considered as a point and it had a set of properties X, Y, R, T and L, meaning that:
The position of the rock was (X, Y). The rock would explode at time T, and the explosion would last until time T+L. During the time interval [T, T+L](both ends are included), any ship whose distance from that rock was no more than R would be destroyed.
At time 0, Zheng He's ship was at the position (0, 0), and his ship could also be considered as a point. When talking about "distance", it means the Manhattan Distance. In a plane, the Manhattan Distance between (x1, y1) and (x2, y2) is |x1 - x2| + |y1 - y2|. Zheng He's ship could only move horizontally or vertically. The maximum speed of Zheng He's ship was 1 per second. That means, if Zheng He's ship was at (x, y) now, then 1 second latter it may arrive at any point in the region S( S={(x1,y1) | |x1-x|+|y1-y| <= 1}).
Suppose Zheng He knew every rock's properties. Given time P, Zheng He wanted to know whether he could survive after time P.
输入解释
Input contains several test cases. For each test case:
The first line contains 2 integers, N and P (1<=N<=1000,1<=P<=1000000), indicating that there were N rocks on the sea and Zheng He wanted to know whether he could survive after time P.
Then N lines follow. Each line describes a rock by 5 integers ---- X, Y, R, T and L(-50<=X, Y<=50, 1<=R<=50, 1<=T, L<=10000) mentioned above.
Input ends with N = P = 0.
输出解释
For each test case, If Zheng He can survive after time P, please print "Zheng can survive." But if P <= 100, you should print one extra line "The survive area is : A", where A is the area of the region which Zheng He can safely reach at time P (rounded to 3 digits after the decimal point). If Zheng He cannot survive, please print "Zheng dies at : H", where H is the latest time Zheng He can survive (H is an integer and Zheng He will be alive at time H but be dead at time H+1). Note that there are one space before the mark ":" and one after it.
输入样例
4 30
50 50 50 50 100
-50 50 50 50 100
50 -50 50 50 100
-50 -50 50 50 100
3 20
-1 -4 4 3 7
-4 2 8 6 1
4 -3 10 10 10
0 0
输出样例
Zheng can survive.
The survive area is : 1800.000
Zheng dies at : 10
来自杭电HDUOJ的附加信息
Recommend lcy

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

源链接: HDU-4084

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

共提交 0

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