Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
|---|---|---|---|---|---|---|
| 2023 | Codeforces Round 980 (Div. 1) | FINISHED | False | 7200 | 46990523 | Oct. 20, 2024, 9:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 174 ) | E | Tree of Life | PROGRAMMING | dp greedy trees |
In the heart of an ancient kingdom grows the legendary Tree of Life — the only one of its kind and the source of magical power for the entire world. The tree consists of (n) nodes. Each node of this tree is a magical source, connected to other such sources through magical channels (edges). In total, there are (n-1) channels in the tree, with the (i)-th channel connecting nodes (v_i) and (u_i). Moreover, there exists a unique simple path through the channels between any two nodes in the tree. However, the magical energy flowing through these channels must be balanced; otherwise, the power of the Tree of Life may disrupt the natural order and cause catastrophic consequences. The sages of the kingdom discovered that when two magical channels converge at a single node, a dangerous "magical resonance vibration" occurs between them. To protect the Tree of Life and maintain its balance, it is necessary to select several paths and perform special rituals along them. A path is a sequence of distinct nodes (v_1, v_2, \ldots, v_k), where each pair of adjacent nodes (v_i) and (v_{i+1}) is connected by a channel. When the sages perform a ritual along such a path, the resonance vibration between the channels ((v_i, v_{i+1})) and ((v_{i+1}, v_{i+2})) is blocked for each (1 \leq i \leq k - 2). The sages' task is to select the minimum number of paths and perform rituals along them to block all resonance vibrations. This means that for every pair of channels emanating from a single node, there must exist at least one selected path that contains both of these channels. Help the sages find the minimum number of such paths so that the magical balance of the Tree of Life is preserved, and its power continues to nourish the entire world! Each test consists of multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 4 \cdot 10^4)) — the number of test cases. The description of the test cases follows. The |
| 135341 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 287014470 | potato167 | E | Oct. 20, 2024, 11:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 71 | 1499 | 199987200 | ||
| 287136147 | rqoi031 | E | Oct. 21, 2024, 1:46 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 531 | 67584000 | ||
| 287074679 | leihonglongyin | E | Oct. 20, 2024, 2:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 609 | 67481600 | ||
| 287139816 | nbhoanh09hanoi | E | Oct. 21, 2024, 3:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 640 | 67276800 | ||
| 287009170 | taeyeon_ss | E | Oct. 20, 2024, 10:51 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 640 | 73216000 | ||
| 287009293 | kotatsugame | E | Oct. 20, 2024, 10:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 671 | 79667200 | ||
| 287100749 | stepanov.aa | E | Oct. 20, 2024, 5:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 687 | 95436800 | ||
| 287010378 | jeroenodb | E | Oct. 20, 2024, 10:54 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 702 | 101888000 | ||
| 287072067 | zwh2008 | E | Oct. 20, 2024, 1:50 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 703 | 77516800 | ||
| 287034992 | orzdevinwang | E | Oct. 20, 2024, 12:02 p.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 734 | 125644800 | ||
| 287004818 | yuto1115 | E | Oct. 20, 2024, 10:43 a.m. | OK | C++20 (GCC 13-64) | TESTS | 71 | 749 | 102092800 | ||
| 287145765 | Str0nger | E | Oct. 21, 2024, 4:35 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 624 | 77312000 | ||
| 286990891 | jiangly | E | Oct. 20, 2024, 10:15 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 655 | 77619200 | ||
| 287081269 | Benq | E | Oct. 20, 2024, 2:56 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 781 | 121651200 | ||
| 287003441 | maroonrk | E | Oct. 20, 2024, 10:40 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 71 | 1108 | 126566400 |
Back to search problems