포럼
문제 ICPC00305

D. Dune Dash

설명

You signed up for the Dune Dash, a running race across the desert. Everything went well — except that in the excitement, you forgot to start StrideTrack, the app that records how far you’ve run. All you have now are the official checkpoint locations, but not the order in which you passed through them.

Formally, the race consisted of \(N\) checkpoints, each given by its coordinates in the Euclidean plane. The sequence in which they were visited is unknown to you, but the organizers designed the course to prevent anyone from straying off route. In particular, if \(q_1, q_2, \dots, q_N\) is the correctly ordered list of the checkpoints along the race, then for every triple \(i < j < k\) it holds that

$$ \text{dist}(q_i, q_k) > \max(\text{dist}(q_i, q_j), \text{dist}(q_j, q_k) ) $$

where \(\text{dist}(p,q)\) denotes the Euclidean distance between points \(p\) and \(q\). Your task is to determine the total length of the race.

figure*[h]

figure*

제약
입력 형식

The first line consists of the integer \(N\) (\(2 \leq N \leq 2 \cdot 10^5\)). The following \(N\) lines each contain two integers \(x_i\) and \(y_i\) (\(-10^9 \leq x_i, y_i \leq 10^9\)). These are the coordinates of each checkpoint.

The checkpoints are not necessarily in the order in which they were visited during the race. It is guaranteed that there is some ordering of the checkpoints such that they satisfy the distance requirements above.

The \(N\) points given in the input are all distinct.

출력 형식

Print one floating point number, the length of the race. Your answer will be correct if it has an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
3
1 0
0 0
1 1
출력
2.0
예제 2
입력
10
-1 -7
-1 -11
0 -9
2 2
1 -2
2 -1
3 1
-1 -5
0 -3
-3 -11
출력
17.186912597118443
문제 정보

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

출처 ICPC NCPC 2025

평가 및 의견

D. Dune Dash

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

Log in to rate problems.

개별 의견

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

풀이 제출

D. Dune Dash

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