慕雪少年与起床战争
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Problem Background
In a game of Bed Wars, Muxue's bed was destroyed by enemies right at the start. His teammates quit the game, leaving only Muxue alone. Although Muxue is at a disadvantage in this round, he is a strong player and will not surrender.
The courage to turn the tide in a desperate situation is the true reflection of your dignity.
"Just as in building a mound, if I stop one basket short, the stopping is my own doing. Just as in leveling the ground, even if I have only dumped one basket of soil, the advancing is my own doing."
Problem Description
Muxue keenly observes that there are now enemy teams whose beds have not yet been destroyed. The bed of the -th team is located at , and Muxue's hatred value toward this team is .
Design a bed-destroying route that starts at and destroys all beds in non-increasing order of hatred value, such that the total distance traveled is minimized. Note that you may pass by a bed without destroying it, and this does not violate the "non-increasing hatred value" constraint.
Input Format
The first line contains an integer .
The next lines each contain three integers: .
Output Format
Output a single real number — the shortest distance, rounded to two decimal places.
Sample Input/Output 1
Input
5
2 3 4
2 2 4
1 1 12
-1 1 12
1 2 8
Output
6.41
Data Scale and Constraints
Let be the maximum number of teams with the same in a test case.
Subtask 1 (10 points):
Subtask 2 (10 points): ,
Subtask 3 (20 points):
Subtask 4 (20 points):
Subtask 5 (40 points): No additional constraints
For all data:, , , .
【XJS-C5-Div3】XJSOI 春节大月赛 Round 3 & 勰码可达鸭合作赛 Round 1
- 状态
- 已结束
- 规则
- IOI
- 题目
- 5
- 开始于
- 2026-2-14 0:00
- 结束于
- 2026-2-17 0:00
- 持续时间
- 4 小时
- 主持人
- 参赛人数
- 7