포럼
문제 ICPC00207

D. Delft Distance

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

You are currently in your hotel at the north-west corner of Delft, and want to go to the contest site at the university in the south-east corner of Delft. To get there, you have to go right through the historical centre of the city. Like Manhattan, the city consists of a grid of \(h \times w\) buildings. But unlike Manhattan, the city does not only contain square residential buildings but also some round medieval towers. All the square buildings are axis aligned with a side length of \(10~\text{m}\) and all round towers have a diameter of \(10~\text{m}\). There is just enough space for a small alley of negligible width between two neighbouring buildings.

Since you are already late for the contest start, you need to find a shortest path from your hotel to the contest site. Fortunately, you have a map of the city. See Figure for an example.

제약
입력 형식

The input consists of:
- One line with two integers \(h\) and \(w\) (\(1 \leq h,w \leq 700\)), the number of rows and the number of columns of buildings shown on the map of the city.
- \(h\) lines, each with \(w\) characters which are either 'O' (for round towers) or 'X' (for square buildings) describing the shapes of the buildings.

The map is oriented with the north side up.

출력 형식

Output the length of a shortest path from the north-west corner to the south-east corner of Delft in metres. Your answer may have a relative or absolute error of at most \(10^{-6}\).

예제 1
입력
3 5
XOOXO
OXOXO
XXXXO
출력
71.4159265359
예제 2
입력
1 4
XOOX
출력
45.7079632679
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2022

평가 및 의견

D. Delft Distance

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

D. Delft Distance

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8