Order Capital Round 1 (Codeforces Round 1038, 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
2122 Order Capital Round 1 (Codeforces Round 1038, Div. 1 + Div. 2) FINISHED False 8100 23469923 July 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2456 ) D Traffic Lights PROGRAMMING brute force dp graphs shortest paths

You are given a simple undirected connected graph of (n) vertices and (m) edges. There is a token in vertex (1). We consider the initial time to be at (0) seconds. After (t) seconds, if the token is in vertex (u), you must do exactly one of the following: wait one second, move the token through the ((t \bmod \mathrm{deg}(u) + 1))(^{\text{∗}})-th edge of (u), which takes one second. The order of edges of a vertex is the order that they appear in the input. Calculate the minimum time required to move the token from vertex (1) to vertex (n), and the minimum time spent waiting that can be achieved while minimizing the total time. (^{\text{∗}})(x \bmod y) denotes the remainder from dividing (x) by (y). 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), (m) ((2 \leq n \leq 5000), (n - 1 \leq m \leq \frac{n(n - 1)}{2})) — the number of vertices and edges in the graph, respectively. Then (m) lines follow, the (i)-th line containing two integers (u_i) and (v_i) ((1 \leq u_i, v_i \leq n)) — the vertices of the (i)-th edge. It is guaranteed that the graph is connected and simple. It is guaranteed that the sum of (n) over all test cases does not exceed (5000), and the sum of (m) over all test cases does not exceed (5\cdot 10^5). For each test case, output a single line containing two integers — the minimum total time and the minimum waiting time that minimizes the total time, respectively. In the first test case, an optimal strategy is to do the following: at time (0), wait one second, at time (1), move the token from vertex (1) to vertex (5), at time (2), wait one second, at time (3), move the token from vertex (5) to vertex (6). In the second test c

Tutorials

Order Capital Round 1 (Codeforces Round 1038, 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
329876282 mban259 D July 19, 2025, 4:45 p.m. OK C# 13 TESTS 30 827 202035200
329913013 hzk_cpp D July 20, 2025, 1:27 a.m. OK C++17 (GCC 7-32) TESTS 31 202 3072000
329882946 lotusblume D July 19, 2025, 5:31 p.m. OK C++17 (GCC 7-32) TESTS 30 202 3174400
329880885 cbdsopa D July 19, 2025, 5:18 p.m. OK C++17 (GCC 7-32) TESTS 30 202 3276800
329881080 wind_cross D July 19, 2025, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 30 202 3379200
329919362 zjwwjhy D July 20, 2025, 3:29 a.m. OK C++17 (GCC 7-32) TESTS 31 203 3276800
329913157 Lyccrius D July 20, 2025, 1:30 a.m. OK C++17 (GCC 7-32) TESTS 31 217 7065600
329893327 kyuukyuusha D July 19, 2025, 6:58 p.m. OK C++17 (GCC 7-32) TESTS 30 217 7270400
329916635 bubbarob19 D July 20, 2025, 2:43 a.m. OK C++17 (GCC 7-32) TESTS 31 218 3174400
329873106 shekhawat22 D July 19, 2025, 4:38 p.m. OK C++17 (GCC 7-32) TESTS 30 218 3174400
329924005 WilliamFranklin D July 20, 2025, 4:44 a.m. OK C++17 (GCC 7-32) TESTS 32 218 3276800
329913193 Raj_Gaurav_ D July 20, 2025, 1:31 a.m. OK C++20 (GCC 13-64) TESTS 31 171 3276800
329897735 tourust D July 19, 2025, 7:52 p.m. OK C++20 (GCC 13-64) TESTS 30 171 3276800
329902603 SaltyDonut D July 19, 2025, 9:04 p.m. OK C++20 (GCC 13-64) TESTS 31 171 3379200
329888816 ademby D July 19, 2025, 6:15 p.m. OK C++20 (GCC 13-64) TESTS 30 171 3379200
329909741 lad1chka D July 19, 2025, 11:46 p.m. OK C++20 (GCC 13-64) TESTS 31 186 3379200
329891659 enzopsm D July 19, 2025, 6:41 p.m. OK C++20 (GCC 13-64) TESTS 30 186 5939200
329883357 Drink_to_forget D July 19, 2025, 5:34 p.m. OK C++20 (GCC 13-64) TESTS 30 187 3072000
329883615 eric574 D July 19, 2025, 5:35 p.m. OK C++20 (GCC 13-64) TESTS 30 187 3379200
329882504 Carucao D July 19, 2025, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 30 202 3276800
329881403 nwblanton D July 19, 2025, 5:21 p.m. OK C++20 (GCC 13-64) TESTS 30 202 3276800
329921996 Lylova D July 20, 2025, 4:11 a.m. OK C++23 (GCC 14-64, msys2) TESTS 32 171 3379200
329915149 VietVu D July 20, 2025, 2:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 31 171 3379200
329914311 binminh01 D July 20, 2025, 1:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 31 171 3379200
329912577 VietVu D July 20, 2025, 1:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 31 171 3379200
329910776 Galetx D July 20, 2025, 12:24 a.m. OK C++23 (GCC 14-64, msys2) TESTS 31 171 3379200
329914306 blscar1999 D July 20, 2025, 1:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 31 186 3379200
329891559 defnotmee D July 19, 2025, 6:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 186 6246400
329926170 WuHuaRou D July 20, 2025, 5:16 a.m. OK C++23 (GCC 14-64, msys2) TESTS 32 187 3379200
329905981 EduardoBrito D July 19, 2025, 9:51 p.m. OK C++23 (GCC 14-64, msys2) TESTS 31 187 3379200
329897568 righteous_child D July 19, 2025, 7:50 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 187 3379200
329896590 rainboy D July 19, 2025, 7:38 p.m. OK GNU C11 TESTS 30 218 18534400
329896976 rainboy D July 19, 2025, 7:42 p.m. OK GNU C11 TESTS 30 233 18841600
329896654 rainboy D July 19, 2025, 7:38 p.m. OK GNU C11 TESTS 30 249 18739200
329896236 rainboy D July 19, 2025, 7:33 p.m. OK GNU C11 TESTS 30 249 18841600
329896686 rainboy D July 19, 2025, 7:39 p.m. OK GNU C11 TESTS 30 280 18841600
329868352 Dominion948 D July 19, 2025, 4:27 p.m. OK Go TESTS 30 453 19148800
329912414 Bogys D July 20, 2025, 1:12 a.m. OK Java 21 TESTS 31 656 39424000
329914207 Lilypad D July 20, 2025, 1:57 a.m. OK Java 21 TESTS 31 828 145920000
329891251 pierrot D July 19, 2025, 6:37 p.m. OK PyPy 3-64 TESTS 30 781 25600000
329928615 jvatsal0709 D July 20, 2025, 5:46 a.m. OK PyPy 3-64 TESTS 32 858 25395200
329887567 LightHouse1 D July 19, 2025, 6:05 p.m. OK PyPy 3-64 TESTS 30 874 24985600
329883911 smz.26 D July 19, 2025, 5:37 p.m. OK PyPy 3-64 TESTS 30 905 36352000
329923647 shanks_jr10 D July 20, 2025, 4:38 a.m. OK PyPy 3-64 TESTS 32 952 25702400
329913451 Little_Sheep_Yawn D July 20, 2025, 1:39 a.m. OK PyPy 3-64 TESTS 31 1046 33587200
329874037 pifagorgor D July 19, 2025, 4:40 p.m. OK PyPy 3-64 TESTS 30 1171 27545600
329872992 chinerist D July 19, 2025, 4:38 p.m. OK PyPy 3-64 TESTS 30 1343 27955200
329877292 savsmail D July 19, 2025, 4:47 p.m. OK PyPy 3-64 TESTS 30 1687 39219200
329927685 Alliy666 D July 20, 2025, 5:35 a.m. OK PyPy 3-64 TESTS 32 1749 31948800
329906712 Martician D July 19, 2025, 10:07 p.m. OK Rust 2021 TESTS 31 186 8908800
329870421 NagisaF D July 19, 2025, 4:32 p.m. OK Rust 2021 TESTS 30 234 8908800
329881091 Ming_Xu D July 19, 2025, 5:19 p.m. OK Rust 2021 TESTS 30 296 8806400
329923618 Spheniscine D July 20, 2025, 4:38 a.m. OK Rust 2021 TESTS 32 327 8908800
329923720 Spheniscine D July 20, 2025, 4:40 a.m. OK Rust 2021 TESTS 32 342 8908800

remove filters

Back to search problems