포럼
문제 ICPC00368

C. Coherency

설명

It is the 25th of March, 40025 CE in the world of Battle Axe Player Clash 40,000 (BAPC40K). This futuristic table-top miniatures wargame is played with endearing figurines called models, each of which is placed on a circular base. The models are placed on a \(100\,\text{km} \times 100\,\text{km}\) gaming board. A collection of such models forms a coherent unit if between any pair of models there is an unbroken chain of models that have a Euclidean distance of at most two inches Recall that an inch equals \(25.4\,\text{mm}\). between the edges of their bases. Moreover, if the unit contains seven models or more, each model must be within two inches of at least two other models. Given the positions of a collection of models with varying base diameters, determine whether they form a single coherent unit.

One can prove that for any valid input for this problem, if the diameters of the circular bases differ from the given diameter by at most \(10^{-5}\,\text{mm}\), the coherency of a unit of models does not change.

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(2\leq n \leq 2\cdot 10^5\)), the number of models.
- \(n\) lines, each with three integers \(x\), \(y\), and \(d\) (\(0 \leq x, y \leq 10^8\),

\(d\in\{25, 28, 32, 40, 50, 65, 80, 90, 100, 130, 160\}\)), describing a model that has its center coordinates at \((x,y)\) and a base diameter of \(d\), all given in millimeters.

Each model (including the base) fits on the gaming board.

It is guaranteed that no two models are overlapping, but the models can touch.

출력 형식

If the \(n\) models form a single coherent unit, output "yes". Otherwise, output "no".

예제 1
입력
2
13 13 25
88 13 25
출력
yes
예제 2
입력
2
13 13 25
89 13 25
출력
no
예제 3
입력
7
1255 1120 65
1204 1226 160
1090 1252 65
998 1179 160
998 1061 65
1090 988 160
1204 1014 65
출력
no
예제 4
입력
7
1066 910 130
1007 1032 130
875 1062 130
770 978 130
770 843 130
875 758 130
1007 788 130
출력
yes
문제 정보

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

출처 ICPC BAPC 2025

평가 및 의견

C. Coherency

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

Log in to rate problems.

개별 의견

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

풀이 제출

C. Coherency

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