Logo
(追記) (追記ここまで)

4683번 - The Doors 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB36181657.143%

문제

You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points of the path are always (0,5) and (10,5). There will also be from 0 to 18 vertical walls inside the chamber, each with two doorways. The finger below illustrates such a chamber and also shows the path of minimal length.

입력

The input data for the illustrated chamber would appear as follows.

2
4 2 7 8 9
7 3 4 5 6 7

The first line contains the number of interior walls. Then there is a line for each such wall, containing five real numbers, The first number is the x coordinate of the wall (0 < x < 10), and the remaining four are the y coordinates of the ends if the doorways in that wall. The x coordinates of the walls are in increasing order and within each line the y coordinates are in increasing order. The input file will contain at least one such set of data. The end of the data comes when the number of walls is -1.

출력

The output file should contain one line of output for each chamber. The line should contain the minimal path length rounded to two decimal places past the decimal point, and always showing the two decimal places past the decimal point. The line should contain no blanks.,

제한

예제 입력 1

1
5 4 6 7 8
2 
4 2 7 8 9
7 3 4.5 6 7
-1

예제 출력 1

10.00
10.06

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 1996 Mid-Central Regional Programming Contest B번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /