10077_Gopherandhawks

2022-5-16 18:16| 发布者: Hocassian| 查看: 79| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504519678700-Problem List-采集的数据-后羿采集器.html

Pro.ID

10077

Title

Gopher and hawks

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10077

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    A gopher sits in a hole located at (xs, ys) and wants to get to a hole located at (xt, yt). The gopher can run at a constant speed of v m/sec. However, if the gopher is outside of a hole for more than a m minutes he will become a supper to hawks flying over the holes. Can the gopher make it?

    输入

    The first line of input contains two positive integer numbers: v -- gopher's speed in meters per second and m -- the time after which the gopher becomes prey to hawks if he stays outside a hole. The second line of input contains two floating point numbers: the (xs,ys) coordinates of the gopher starting hole. The third line contains the (xt, yt) coordinates of the target hole. Each Subsequent line of input contains two floating point numbers: the (x,y) coordinates of a gopher hole. All distances are in metres, to the nearest mm.

    输出

    Description

    A gopher sits in a hole located at (xs, ys) and wants to get to a hole located at (xt, yt). The gopher can run at a constant speed of v m/sec. However, if the gopher is outside of a hole for more than a m minutes he will become a supper to hawks flying over the holes. Can the gopher make it?

    Input

    The first line of input contains two positive integer numbers: v -- gopher's speed in meters per second and m -- the time after which the gopher becomes prey to hawks if he stays outside a hole. The second line of input contains two floating point numbers: the (xs,ys) coordinates of the gopher starting hole. The third line contains the (xt, yt) coordinates of the target hole. Each Subsequent line of input contains two floating point numbers: the (x,y) coordinates of a gopher hole. All distances are in metres, to the nearest mm.

    Output

    If the gopher can make it to the target hole, the output line should read "Yes, visiting n other holes.", where n is the minimal number of intermediate holes the gopher has to visit. If the gopher cannot make it the output line should read "No." There are not more than 1000 gopher holes and all coordinates are between -10000 and +10000.

    Sample Input
    3 1
    0.000 0.000
    500.000 0.000
    179.000 0.000
    358.000 0.000
    Sample Output

    Yes, visiting 2 other holes.

    Hint

    Sample input 2
    5 1
    0.000 0.000
    0.000 550.000
    179.000 0.000
    0.000 301.000


    Output for sample input 2
    No.

    Source

    样例输入

    3 1
    0.000 0.000
    500.000 0.000
    179.000 0.000
    358.000 0.000

    样例输出

    Yes, visiting 2 other holes.

    提示

    Sample input 2
    5 1
    0.000 0.000
    0.000 550.000
    179.000 0.000
    0.000 301.000


    Output for sample input 2
    No.


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部