跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F0518. Problem C: Snow Clearing

    ID: 524 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>待分类整理状态难度待定难度共享题库高校与竞赛共享题英文题面题目来源题面语言

Problem C: Snow Clearing

题目描述

Problem C: Snow Clearing

As the days become shorter and the nights become longer we turn our thoughts to snow clearing. Due to budget cuts, the Big Noisy City has exactly one snow plow. The plow can clear exactly one lane of a road in a single pass. Whenever there is snow on the ground, the plow departs from its hangar and tours the city, plowing as it goes. What is the minimum time that the plow needs to clear every lane of every road?

The first line of input contains two integers: the x,y coordinates of the hangar (in metres). Up to 100 lines follow. Each gives the coordinates (in metres) of the beginning and end of a street. All roads are perfectly straight, with one lane in each direction. The plow can turn any direction (including a U-turn) at any intersection, and can turn around at the end of any street. The plow travels at 20 km/h if it is plowing, and 50 km/h if the lane it is driving on has already been plowed. It is possible to reach all streets from the hangar.

Your output should be the time, in hours and minutes, required to clear the streets and return to the hangar. Round to the nearest minute.

样例 1

输入

0 0
0 0 10000 10000
5000 -10000 5000 10000
5000 10000 10000 10000

输出

3:55

题目来源:fps-zhblue-waterloo-010929.xml;FPS 共享题包,题包内第 3 题。保留原作者与原赛事署名。