#P15241. [NHSPC 2025] 資料中心
[NHSPC 2025] 資料中心
Problem Description
HyperNet, the world’s largest cloud infrastructure provider, is building the next generation of distributed data centers. The company has deployed cloud hosts around the world, numbered . The hosts are interconnected by fiber links . Each fiber link connects two different hosts , and has a positive integer maintenance cost . This huge distributed network will support global data exchange, AI model training, and real-time services in the future.
However, to deal with energy shortages and increasingly serious cyberattacks, HyperNet decides to use a dynamic connectivity strategy. That is, each fiber link can only be turned on during a specific time interval (but it does not have to be turned on), in order to reduce energy usage and the attack surface. As a result, the network topology is no longer fixed at different times, and it may even split into multiple isolated segments.
To ensure that all hosts can communicate with each other, the data center security control center needs, at every time point satisfying , to automatically decide which fiber links to turn on from the set of links that can be turned on , so that all hosts can communicate with each other and the total maintenance cost of the turned-on links is minimized.
For example, suppose there are hosts and fiber links . The endpoints, maintenance costs, and available time intervals are as follows:
- , and it can be turned on during .
- , and it can be turned on during .
- , and it can be turned on during .
- , and it can be turned on during .
- , and it can be turned on during .
Then:
- At time point , the links that can be turned on are . Even if all of them are turned on, still cannot be connected, so it is impossible to make all hosts connected at time point .
- At time point , the links that can be turned on are . Turning on all of them connects all hosts, with total maintenance cost .
- At time point , the links that can be turned on are . If we turn on , the maintenance cost is ; any other combination of links has a maintenance cost greater than .
- At all other times, it is impossible to connect all hosts.
Input Format
$$\begin{aligned} &n \; m \; d \\ &u_1 \; v_1 \; w_1 \; l_1 \; r_1 \\ &u_2 \; v_2 \; w_2 \; l_2 \; r_2 \\ &\vdots \\ &u_m \; v_m \; w_m \; l_m \; r_m \end{aligned}$$- is the number of nodes.
- is the number of edges.
- is the upper bound of time points.
- mean that there is a fiber link connecting host and host with maintenance cost , and it can be turned on during the interval .
Output Format
$$\begin{aligned} &a_0 \; a_1 \; a_2 \; \ldots \; a_{d-1} \end{aligned}$$- is the minimum maintenance cost to connect all hosts at time point . If it is impossible to connect the hosts at that time point, then .
5 5 6
1 2 5 0 4
2 3 1 0 4
4 5 3 2 6
5 1 1 1 5
2 5 2 3 6
-1 -1 10 7 -1 -1
6 10 6
1 2 5 0 6
1 6 1 4 6
3 4 2 3 6
5 2 4 2 6
4 5 1 0 6
6 3 9 5 6
3 4 8 0 6
3 2 6 0 6
1 4 3 1 6
6 5 4 0 6
24 19 18 14 11 11
4 8 7
1 4 1 4 5
2 3 1 0 7
2 1 1 0 1
4 2 1 1 3
3 1 1 2 6
1 2 1 5 7
3 4 1 0 3
4 3 1 6 7
3 -1 3 -1 3 -1 3
Hint
Constraints
- .
- 。
- 。
- , and .
- .
- .
- All input values are integers.
Scoring
This problem has five subtasks, with the constraints as follows. Each subtask may contain one or more pieces of testdata. You will get the score for a subtask only if you pass all testdata in that subtask.
| Subtask | Score | Additional Input Constraints |
|---|---|---|
| 1 | 5 | . |
| 2 | 9 | , . |
| 3 | 21 | . |
| 4 | 26 | . |
| 5 | 39 | No additional constraints. |
Translated by ChatGPT 5