Codeforces Round 1077 (Div. 1)

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
2187 Codeforces Round 1077 (Div. 1) FINISHED False 10800 6708323 Jan. 29, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1332 ) C Jerry and Tom PROGRAMMING data structures dfs and similar games graphs greedy trees

Jerry and Tom are playing a game on a directed graph (G) with (n) vertices, numbered from (1) to (n). For every vertex (1 \le u < n), there is a directed edge from (u) to (u+1). In addition, there are (m) extra directed edges. The (i)-th extra edge goes from (u_i) to (v_i), where (1 \le u_i < v_i \le n). The graph (G) has the following special property: there do not exist two directed edges ((u_i\to v_i)) and ((u_j\to v_j)) such that (u_i < u_j < v_i < v_j). At the beginning of the game, Jerry and Tom stand on vertices (x) and (y), respectively, where (x \ne y). The game proceeds in turns. In each turn, the players behave according to the following rules, with Jerry going first, followed by Tom: Jerry must choose one outgoing edge from his current vertex and move along it to its end. If his current vertex has no outgoing edges, he stays where he is. Tom may choose one outgoing edge from his current vertex and move along it to its end, or choose not to move and stay where he is. If at the end of any turn, Jerry and Tom are at the same vertex ( including at vertex (n) ), the game ends immediately and Tom wins. Otherwise, if Jerry is initially at vertex (n), or reaches vertex (n) at the end of any turn, Jerry wins. Note that if after a turn, both Jerry and Tom are at vertex (n), then Tom wins . Throughout the entire game, both players know each others' locations. It can be proven that the game will end in a finite number of turns. For a pair of integers (1 \le x,y \le n), (x \ne y), define (f(x,y)) as follows: Jerry and Tom will play a game, where Jerry starts at vertex (x) and Tom starts at vertex (y). Tom wants to win, but he also wants to minimise the number of times he actually moves (that is, the number of turns in which he changes his vertex; staying still does not count as a move ). Assuming both players play optimally, let (f(x,y)=0) if

Tutorials

Codeforces Round 1077 (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
360558000 pmt2018 C Jan. 29, 2026, 3:42 p.m. OK C++17 (GCC 7-32) TESTS 21 93 32768000
360591960 SDSXC C Jan. 29, 2026, 4:36 p.m. OK C++17 (GCC 7-32) TESTS 21 125 19865600
360648121 CCCCOrz C Jan. 30, 2026, 12:35 a.m. OK C++17 (GCC 7-32) TESTS 22 125 28057600
360596308 CCCCOrz C Jan. 29, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 21 125 28876800
360524538 Um_nik C Jan. 29, 2026, 3:07 p.m. OK C++17 (GCC 7-32) TESTS 21 140 38912000
360528632 potato167 C Jan. 29, 2026, 3:11 p.m. OK C++17 (GCC 7-32) TESTS 21 156 10240000
360596344 xtzic C Jan. 29, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 21 156 12390400
360634966 timg8710 C Jan. 29, 2026, 8:23 p.m. OK C++17 (GCC 7-32) TESTS 21 156 17100800
360645067 naromil C Jan. 29, 2026, 11:09 p.m. OK C++17 (GCC 7-32) TESTS 22 156 22016000
360547005 fast_photon C Jan. 29, 2026, 3:29 p.m. OK C++17 (GCC 7-32) TESTS 21 156 25804800
360560853 JDScript0117 C Jan. 29, 2026, 3:46 p.m. OK C++20 (GCC 13-64) TESTS 21 109 29593600
360651923 seanlsy C Jan. 30, 2026, 2:16 a.m. OK C++20 (GCC 13-64) TESTS 22 109 39731200
360591956 Hosen_ba C Jan. 29, 2026, 4:36 p.m. OK C++20 (GCC 13-64) TESTS 21 125 34918400
360598678 kookeudas C Jan. 29, 2026, 4:50 p.m. OK C++20 (GCC 13-64) TESTS 21 125 37990400
360600642 Tenshi C Jan. 29, 2026, 4:55 p.m. OK C++20 (GCC 13-64) TESTS 21 125 38400000
360552062 Remedy943 C Jan. 29, 2026, 3:35 p.m. OK C++20 (GCC 13-64) TESTS 21 125 41062400
360576087 Kude C Jan. 29, 2026, 4:08 p.m. OK C++20 (GCC 13-64) TESTS 21 125 46489600
360604989 DuanQingQiu C Jan. 29, 2026, 5:06 p.m. OK C++20 (GCC 13-64) TESTS 21 125 50790400
360602978 xiao_lang C Jan. 29, 2026, 5:01 p.m. OK C++20 (GCC 13-64) TESTS 21 125 124416000
360581840 natsugiri C Jan. 29, 2026, 4:17 p.m. OK C++20 (GCC 13-64) TESTS 21 140 14131200
360596362 lelyte C Jan. 29, 2026, 4:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 109 50176000
360569486 OIer_kzc C Jan. 29, 2026, 3:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 109 93081600
360526695 ecnerwala C Jan. 29, 2026, 3:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 6758400
360574368 Arnav_Singhal1 C Jan. 29, 2026, 4:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 39321600
360580785 AbdelmagedNour C Jan. 29, 2026, 4:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 41267200
360599862 TeletubiGaim33 C Jan. 29, 2026, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 41881600
360582550 tianbincheng C Jan. 29, 2026, 4:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 43110400
360658893 Brilliance_2 C Jan. 30, 2026, 4:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 22 125 44851200
360551958 YuukiS C Jan. 29, 2026, 3:35 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 45772800
360558298 N.N_2004 C Jan. 29, 2026, 3:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 21 125 47411200
360651313 tarun_op C Jan. 30, 2026, 2:02 a.m. OK Java 21 TESTS 22 843 130252800
360581537 MBBN C Jan. 29, 2026, 4:17 p.m. OK Java 21 TESTS 21 953 100864000
360652943 _Ambitious_ C Jan. 30, 2026, 2:38 a.m. OK Java 8 TESTS 22 375 41369600
360528645 Tlatoani C Jan. 29, 2026, 3:11 p.m. OK Kotlin 2.2 TESTS 21 953 105676800
360570285 harurun4635 C Jan. 29, 2026, 3:59 p.m. OK PyPy 3-64 TESTS 21 296 39116800
360649239 smilences C Jan. 30, 2026, 1:10 a.m. OK PyPy 3-64 TESTS 22 343 106700800
360607772 Jank C Jan. 29, 2026, 5:13 p.m. OK PyPy 3-64 TESTS 21 531 64921600
360570692 chinerist C Jan. 29, 2026, 4 p.m. OK PyPy 3-64 TESTS 21 562 114483200
360634433 golomb C Jan. 29, 2026, 8:18 p.m. OK PyPy 3-64 TESTS 21 703 76595200
360572723 Go_Goat_Goal C Jan. 29, 2026, 4:03 p.m. OK PyPy 3-64 TESTS 21 718 127590400
360649196 smilences C Jan. 30, 2026, 1:08 a.m. OK PyPy 3-64 TESTS 22 765 127590400
360606614 dyppp C Jan. 29, 2026, 5:10 p.m. OK PyPy 3-64 TESTS 21 765 178790400
360632605 Little_Sheep_Yawn C Jan. 29, 2026, 7:57 p.m. OK PyPy 3-64 TESTS 21 796 127590400
360595692 kdy8128 C Jan. 29, 2026, 4:44 p.m. OK PyPy 3-64 TESTS 21 921 130662400
360587140 drydock C Jan. 29, 2026, 4:27 p.m. OK Rust 2024 TESTS 21 78 44236800
360537694 Egor C Jan. 29, 2026, 3:20 p.m. OK Rust 2024 TESTS 21 125 77209600
360575229 darkkcyan C Jan. 29, 2026, 4:07 p.m. OK Rust 2024 TESTS 21 125 88268800
360543358 Darknef C Jan. 29, 2026, 3:26 p.m. OK Rust 2024 TESTS 21 187 62976000
360559970 Mon_ster C Jan. 29, 2026, 3:45 p.m. OK Rust 2024 TESTS 21 296 53350400

remove filters

Back to search problems