Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2)

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
2222 Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) FINISHED False 9000 1437864 April 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 595 ) F Building Tree PROGRAMMING divide and conquer dsu graphs implementation

Exber has an undirected graph with (n) vertices and (m) edges. The (i)-th edge connects vertices (u_i) and (v_i) and has weight (w_i). For every path, let the weights of the edges in it form a set (S); then the length of this path is defined as (\operatorname{mex}(S)). Here, (\operatorname{mex}(S)) denotes the minimum excluded (MEX)(^{\text{∗}}) of the collection (S). Let (\mathrm{dis}(u,v)) denote the minimum path length among all paths starting at (u) and ending at (v). Now, Exber wants to construct a new graph with (q) vertices. In the new graph, the color of the (i)-th vertex is (c_i). Initially, there are no edges in this graph. If Exber adds an edge connecting vertex (u) and vertex (v), it will cost (\mathrm{dis}(c_u,c_v)) time. If vertex (c_u) and vertex (c_v) are not connected in the given graph, Exber can not add an edge connecting vertex (u) and vertex (v) in the new graph. Determine the minimum amount of time Exber needs to spend to make the new graph connected. (^{\text{∗}})The minimum excluded (MEX) of a collection of integers (S_1, S_2, \ldots, S_k) is defined as the smallest non-negative integer (x) which does not occur in the collection (S). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains three integers (n), (m), and (q) ((1\le n,m\le 3\cdot 10^5), (1\le q\le n)) — the number of nodes in the graph, the number of edges in the graph, and the number of nodes in the new graph, respectively. The next (m) lines each contain three integers (u), (v), and (w) ((1\le u,v\le n), (0\le w\le m)), indicating that there is an edge of weight (w) between vertices (u) and (v). The next line contains (q) integers (c_i) ($$$1\le c

Tutorials

Spectral::Cup 2026 Round 1 (Codeforces Round 1094, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
372515762 nullbrain_ F April 25, 2026, 4:22 p.m. OK C# 13 TESTS 48 2062 107212800
372517378 austin.chen F April 25, 2026, 4:28 p.m. OK C++17 (GCC 7-32) TESTS 48 718 28876800
372522056 lcy6 F April 25, 2026, 4:46 p.m. OK C++17 (GCC 7-32) TESTS 48 734 20480000
372554760 chengyi_ F April 26, 2026, 1:08 a.m. OK C++17 (GCC 7-32) TESTS 48 765 18636800
372513545 MODDI F April 25, 2026, 4:14 p.m. OK C++17 (GCC 7-32) TESTS 48 781 28774400
372525910 ProvenConjecture F April 25, 2026, 5:01 p.m. OK C++17 (GCC 7-32) TESTS 48 812 67891200
372519434 chongtzezhao F April 25, 2026, 4:35 p.m. OK C++17 (GCC 7-32) TESTS 48 828 24576000
372549636 codeBreaker_krrishb F April 25, 2026, 10:13 p.m. OK C++17 (GCC 7-32) TESTS 48 843 18432000
372525040 AlphaCodeKiller F April 25, 2026, 4:58 p.m. OK C++17 (GCC 7-32) TESTS 48 843 59596800
372508899 SONNENKAISER F April 25, 2026, 3:58 p.m. OK C++17 (GCC 7-32) TESTS 48 859 66560000
372522504 EverlastingEternity F April 25, 2026, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 48 890 22425600
372556018 maxplus F April 26, 2026, 1:27 a.m. OK C++20 (GCC 13-64) TESTS 48 250 11161600
372554681 maxplus F April 26, 2026, 1:06 a.m. OK C++20 (GCC 13-64) TESTS 48 375 15564800
372543954 Geothermal F April 25, 2026, 8:29 p.m. OK C++20 (GCC 13-64) TESTS 48 468 35430400
372520610 Xerxes F April 25, 2026, 4:40 p.m. OK C++20 (GCC 13-64) TESTS 48 484 26828800
372512038 phanvien F April 25, 2026, 4:09 p.m. OK C++20 (GCC 13-64) TESTS 48 562 23756800
372517971 Dinprosperity F April 25, 2026, 4:30 p.m. OK C++20 (GCC 13-64) TESTS 48 640 40345600
372526639 SHARHOOD F April 25, 2026, 5:03 p.m. OK C++20 (GCC 13-64) TESTS 48 671 119296000
372524381 albertbogdanovalbert F April 25, 2026, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 48 687 49561600
372511057 dfgsae F April 25, 2026, 4:05 p.m. OK C++20 (GCC 13-64) TESTS 48 718 102502400
372523828 maxplus F April 25, 2026, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 48 734 26419200
372516735 tatyam F April 25, 2026, 4:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 500 26521600
372518082 peti1234 F April 25, 2026, 4:30 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 500 46489600
372525188 ShmilyTY F April 25, 2026, 4:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 609 19251200
372511276 YuukiS F April 25, 2026, 4:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 625 24268800
372566132 gshbholanath19 F April 26, 2026, 4:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 48 656 27238400
372566164 cuom1999 F April 26, 2026, 4:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 48 656 35532800
372524061 qinjiezyz F April 25, 2026, 4:54 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 656 84377600
372515787 benben181 F April 25, 2026, 4:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 656 119603200
372511351 donnyooo F April 25, 2026, 4:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 656 286924800
372544698 jumpmelon F April 25, 2026, 8:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 48 671 10854400
372509693 lillliliiililill F April 25, 2026, 4:01 p.m. OK GNU C11 TESTS 48 1265 141926400
372510815 bugfeature F April 25, 2026, 4:04 p.m. OK Go TESTS 48 1156 179814400
372524363 adityasinghtomar78 F April 25, 2026, 4:55 p.m. OK Go TESTS 48 2203 302694400
372522979 Mostafa1259 F April 25, 2026, 4:50 p.m. OK Java 21 TESTS 48 875 59289600
372526361 RustyPanda F April 25, 2026, 5:02 p.m. OK Java 21 TESTS 48 1437 533504000
372519538 hardgonnapass F April 25, 2026, 4:36 p.m. OK Java 8 TESTS 48 640 10444800
372526301 arvindf232 F April 25, 2026, 5:02 p.m. OK Kotlin 2.2 TESTS 48 1406 63078400
372516113 bitplease_ F April 25, 2026, 4:23 p.m. OK Node.js TESTS 48 2296 60825600
372508648 Darknef F April 25, 2026, 3:57 p.m. OK Rust 2024 TESTS 48 1109 71168000
372541613 DanielAnker F April 25, 2026, 7:55 p.m. OK Rust 2024 TESTS 48 1328 73113600
372515833 darkkcyan F April 25, 2026, 4:22 p.m. OK Rust 2024 TESTS 48 1656 133120000

remove filters

Back to search problems