Problem C - Snakes

2020年1月17日 1163点热度 0人点赞 2条评论

Problem C - Snakes

时间: 1ms        内存:128M

描述:

Problem C - Snakes

Buffalo Bill wishes to cross a 1000x1000 square field. A number of snakes are on the field at various positions, and each snake can strike a particular distance in any direction. Can Bill make the trip without being bitten?

Assume that the southwest corner of the field is at (0,0) and the northwest corner at (0,1000). The input consists of a line containing n <= 1000, the number of snakes. A line follows for each snake, containing three real numbers: the (x,y) location of the snake and its strike distance. The snake will bite anything that passes closer than this distance from its location.

Bill must enter the field somewhere between the southwest and northwest corner and must leave somewhere between the southeast and northeast corners.

If Bill can complete the trip, give coordinates at which he may enter and leave the field. If Bill may enter and leave at several places, give the most northerly. If there is no such pair of positions, print "Bill will be bitten."

输入:

输出:

示例输入:

3
500 500 499
0 0 999
1000 1000 200

示例输出:

Bill enters at (0.00, 1000.00) and leaves at (1000.00, 800.00).

提示:

参考答案:

解锁文章

没有看到答案?微信扫描二维码可免费解锁文章

微信扫描二维码解锁

使用微信扫描二维码打开广告页面后可以立即关闭,再刷新此页面即可正常浏览此文章

所跳转广告均由第三方提供,并不代表本站观点!

已经扫描此二维码?点此立即跳转

code

这个人很懒,什么都没留下

文章评论

  1. aa说道:

    确定这是参考答案???

    1. jlqwer说道:

      @aa 不确定。。。都是网上批量爬到的