CrossFire
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 42 Accepted Submission(s) : 17
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
Many people have heard of the game "CrossFire", also called "CF". Now leolin indulges in
this game. He has a task that he must cross a 1000x1000 field containing many cannons, each of
which has an attack range. leolin can run in arbitrary direction. But once leolin enter the attack
range of any cannon, leolin will be killed by that fucking thing!
Now he wonders whether he can finish the task. The coordinate of the southwest corner of
the field is (0, 0) and the northwest corner is (0, 1000).
this game. He has a task that he must cross a 1000x1000 field containing many cannons, each of
which has an attack range. leolin can run in arbitrary direction. But once leolin enter the attack
range of any cannon, leolin will be killed by that fucking thing!
Now he wonders whether he can finish the task. The coordinate of the southwest corner of
the field is (0, 0) and the northwest corner is (0, 1000).
Input
The input contains several cases.
The first line of each case contains an integer n (n<=1000), indicating the number of cannons.
Then n lines follows. The i-th line contains three real numbers, x, y, r (0<=x, y<=1000,
1<=r<=2000), where (x, y) indicates the position of the i-th cannon, and r indicates its attack
range.
The cannon can kill anyone that stands closer than this distance from its center. Please note
that it is dangerous to stand on the border of the range, so this behavior is also not allowed. It is
guaranteed that any two of the cannons' attack range would NOT have tangent points and the
cannons' attack ranges would NOT have tangent points with the borders of the field.
The first line of each case contains an integer n (n<=1000), indicating the number of cannons.
Then n lines follows. The i-th line contains three real numbers, x, y, r (0<=x, y<=1000,
1<=r<=2000), where (x, y) indicates the position of the i-th cannon, and r indicates its attack
range.
The cannon can kill anyone that stands closer than this distance from its center. Please note
that it is dangerous to stand on the border of the range, so this behavior is also not allowed. It is
guaranteed that any two of the cannons' attack range would NOT have tangent points and the
cannons' attack ranges would NOT have tangent points with the borders of the field.
Output
leolin must enter the field via a point on the left borderline, and leave on the right borderline.
If leolin can finish the task, given coordinates which he may enter and leave the field using
the format below (accurate to 2 decimal places). If several point can ben entered and left, given
the most norther one.
If he can't finish the task, print "leolin will be killed!" (without the quotes).
If leolin can finish the task, given coordinates which he may enter and leave the field using
the format below (accurate to 2 decimal places). If several point can ben entered and left, given
the most norther one.
If he can't finish the task, print "leolin will be killed!" (without the quotes).
Sample Input
3 0 0 999 500 500 300 1000 1000 400
Sample Output
leolin enters at (0.00, 1000.00) and leaves at (1000.00, 600.00).
Author
Source
2012年华南师范大学校赛初赛