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 |
|---|---|---|---|---|---|---|
| 2147 | Codeforces Global Round 29 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 18026723 | Sept. 20, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 185 ) | H | Maxflow GCD Coloring | PROGRAMMING | flows graphs |
Consider an undirected graph (G) with (n) vertices and positive integer capacities on its edges. We denote by (\textsf{maxflow}(u, v)) the value of the maximum flow in the graph from source (u) to sink (v). We say that such a graph (G) is good if there exists a positive integer (d \geq 2) such that (d) divides each of the (n \cdot (n-1)) values of (\textsf{maxflow}(u, v)) for all pairs ((u, v)) of distinct vertices of (G). Note that, in particular, any graph without edges is good. You are given a graph, and you have to color its vertices so that, for each color, the subgraph induced(^{\text{∗}}) by the vertices of that color is good. Find such a coloring with the minimum possible number of colors. (^{\text{∗}})Subgraph induced by a set of vertices (S) is another graph, whose vertices are (S) and whose edges are all of the edges, from the original graph, connecting pairs of vertices in (S). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 1000)). The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((1 \leq n \leq 50), (0 \leq m \leq \frac{n(n-1)}{2})), the number of vertices and the number of edges of the graph. The next (m) lines each contain three integers (u), (v), (w) ((1 \leq u, v \leq n), (1 \leq w \leq 10^6)), denoting that there is an edge connecting vertices (u) and (v) with capacity (w). It is guaranteed that there are no self-loops or multiple edges between the same vertices. It is guaranteed that the sum of (n^4) over all test cases does not exceed (50^4). It can be shown that other limitations imply that the sum of (m) over all test cases does not exceed (50\,000), so you don't need to worry about the size of the input. For each test case, output one integer (c), the minimum possible n |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 339643224 | masonpop | H | Sept. 21, 2025, 2:57 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 62 | 1638400 | ||
| 339654289 | gooonn | H | Sept. 21, 2025, 5:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 93 | 0 | ||
| 339619877 | 300iq | H | Sept. 20, 2025, 7:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 21 | 577 | 5017600 | ||
| 339630747 | AU25_kirill | H | Sept. 20, 2025, 9:33 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 62 | 0 | ||
| 339611932 | Benq | H | Sept. 20, 2025, 6:47 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 62 | 102400 | ||
| 339637487 | Su_Zipei | H | Sept. 21, 2025, 12:37 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 77 | 0 | ||
| 339644754 | __akash24_13 | H | Sept. 21, 2025, 3:25 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 93 | 0 | ||
| 339612868 | Benq | H | Sept. 20, 2025, 6:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 93 | 0 | ||
| 339592050 | jiangly | H | Sept. 20, 2025, 4:59 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 93 | 102400 | ||
| 339626645 | hos.lyric | H | Sept. 20, 2025, 8:45 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 108 | 0 | ||
| 339594605 | ksun48 | H | Sept. 20, 2025, 5:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 108 | 0 | ||
| 339617021 | wh01sShakin | H | Sept. 20, 2025, 7:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 108 | 102400 | ||
| 339640179 | SomethingNew | H | Sept. 21, 2025, 1:51 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 21 | 109 | 0 |
Back to search problems