22337_Subway

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

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

Pro.ID

22337

Title

Subway

Title链接

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

AC

6

Submit

8

Ratio

75.00%

时间&空间限制

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

    You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want to be late for class, you want to know how long it will take you to get to school.

    You walk at a speed of 10 km/h. The subway travels at 40 km/h. Assume that you are lucky, and whenever you arrive at a subway station, a train is there that you can board immediately. You may get on and off the subway any number of times, and you may switch between different subway lines if you wish. All subway lines go in both directions.

    输入

    Input consists of the x, y coordinates of your home and your school, followed by specifications of several subway lines. Each subway line consists of the non-negative integer x, y coordinates of each stop on the line, in order. You may assume the subway runs in a straight line between adjacent stops, and the coordinates represent an integral number of metres. Each line has at least two stops. The end of each subway line is followed by the dummy coordinate pair -1, -1. In total there are at most 200 subway stops in the city.

    输出

    Description

    You have just moved from a quiet Waterloo neighbourhood to a big, noisy city. Instead of getting to ride your bike to school every day, you now get to walk and take the subway. Because you don't want to be late for class, you want to know how long it will take you to get to school.

    You walk at a speed of 10 km/h. The subway travels at 40 km/h. Assume that you are lucky, and whenever you arrive at a subway station, a train is there that you can board immediately. You may get on and off the subway any number of times, and you may switch between different subway lines if you wish. All subway lines go in both directions.

    Input

    Input consists of the x, y coordinates of your home and your school, followed by specifications of several subway lines. Each subway line consists of the non-negative integer x, y coordinates of each stop on the line, in order. You may assume the subway runs in a straight line between adjacent stops, and the coordinates represent an integral number of metres. Each line has at least two stops. The end of each subway line is followed by the dummy coordinate pair -1, -1. In total there are at most 200 subway stops in the city.

    Output

    Output is the number of minutes it will take you to get to school, rounded to the nearest minute, taking the fastest route.

    Sample Input

    0 0 10000 1000
    0 200 5000 200 7000 200 -1 -1
    2000 600 5000 600 10000 600 -1 -1

    Sample Output

    21

    Source

    样例输入

    0 0 10000 1000
    0 200 5000 200 7000 200 -1 -1
    2000 600 5000 600 10000 600 -1 -1

    样例输出

    21

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部