포럼
문제 ICPC00161

A. Around the Track

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

In order to compare race tracks, we wish to compute their lengths. A racetrack is strictly two-dimensional (no elevation). It is described by two simple polygons, where one is completely contained inside the other. The track is the region between these two polygons. We define the length of the track as the absolute minimum distance that one needs to travel in order to complete a lap. This could involve traveling on the very edge of the track and arbitrarily sharp cornering (see Figure ).

제약
입력 형식

The input consists of:
- one line with one integer \(n\) (\(3 \leq n \leq 50\)), the number of vertices of the inner polygon;
- \(n\) lines, the \(i\)th of which contains two integers \(x_i\) and \(y_i\) (\( -5\,000 \leq x_i, y_i \leq 5\,000\)): the coordinates of the \(i\)th vertex of the inner polygon;
- one line with one integer \(m\) (\(3 \leq m \leq 50\)), the number of vertices of the outer polygon;
- \(m\) lines, the \(i\)th of which contains two integers \(x_i\) and \(y_i\) (\( -5\,000 \leq x_i, y_i \leq 5\,000\)): the coordinates of the \(i\)th vertex of the outer polygon.

For both polygons, the vertices are given in counterclockwise order. The borders of the two polygons do not intersect or touch each other.

출력 형식

Output one line with one floating point number: the length of the race track. Your answer should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
3
1 1
2 1
1 2
3
0 0
4 0
0 4
출력
3.41421356237309
예제 2
입력
5
1 1
5 1
5 5
3 3
1 5
4
0 0
6 0
6 6
0 6
출력
16
예제 3
입력
5
1 1
5 1
5 5
3 3
1 5
5
0 0
6 0
6 6
3 4
0 6
출력
16.4721359549996
문제 정보

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

출처 ICPC NWERC 2014

평가 및 의견

A. Around the Track

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

Log in to rate problems.

개별 의견

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

풀이 제출

A. Around the Track

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