Codeforces Round 905 (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
1887 Codeforces Round 905 (Div. 1) FINISHED False 7200 39207263 Oct. 22, 2023, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3153 ) B Time Travel PROGRAMMING binary search graphs implementation shortest paths

B'Berland is a country with ancient history, where roads were built and destroyed for centuries. It is known that there always were n cities in Berland. You also have records of t key moments in the history of the country, numbered from 1 to t . Each record contains a list of bidirectional roads between some pairs of cities, which could be used for travel in Berland at a specific moment in time. You have discovered a time machine that transports you between key moments. Unfortunately, you cannot choose what point in time to end up at, but you know the order consisting of k moments in time a_{i} , in which the machine will transport you. Since there is little time between the travels, when you find yourself in the next key moment in time (including after the last time travel), you can travel on at most one existing road at that moment, coming out from the city you were in before time travel. Currently, you are in city 1 , and the time machine has already transported you to moment a_{1} . You want to reach city n as quickly as possible. Determine the minimum number of time travels, including the first one, that you need to make in order to reach city n . The first line contains two integers n and t ( 2 <= n <= 2 cdot 10^5, 1 <= t <= 2 cdot 10^5 ) -- the number of cities in Berland and the number of records about key moments in history. Then follows the description of each of the t records. The first line of each record description contains a single integer m_{i} ( 0 <= m_{i} <= min <= ft( frac{n(n-1)}{2}, 2 cdot 10^5 right) ) -- the number of roads in the i -th record. Each of the next m_i lines contains two integers v_{j} and u_{j} ( 1 <= v_{j}, u_{j} <= n , v_{j} neq u_{j} ) -- the numbers of cities connected by the j -th road in the i -th key moment in history. The next line contains a single integer k ($$'...

Tutorials

Codeforces Round #905 (Div. 1, Div. 2, Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
229243561 KumaTachiRen B Oct. 22, 2023, 11:55 a.m. OK C# 8 TESTS 63 483 36966400
229269613 chro4896 B Oct. 22, 2023, 12:36 p.m. OK GNU C11 TESTS 63 156 13619200
229357263 Zxc200611 B Oct. 23, 2023, 1:04 a.m. OK GNU C++14 TESTS 63 202 17920000
229278049 MCPlayer542 B Oct. 22, 2023, 12:49 p.m. OK GNU C++14 TESTS 63 218 12902400
229354070 XZC__Bobby B Oct. 22, 2023, 11:25 p.m. OK GNU C++14 TESTS 63 218 12902400
229313334 karrigan0108 B Oct. 22, 2023, 4:03 p.m. OK GNU C++14 TESTS 63 218 18124800
229250418 L7-56 B Oct. 22, 2023, 12:05 p.m. OK GNU C++14 TESTS 63 234 12697600
229286245 SuperJ6 B Oct. 22, 2023, 1:01 p.m. OK GNU C++14 TESTS 63 248 16998400
229273920 Yuki726 B Oct. 22, 2023, 12:43 p.m. OK GNU C++14 TESTS 63 249 14540800
229231230 busamate B Oct. 22, 2023, 11:37 a.m. OK GNU C++14 TESTS 63 249 16998400
229225565 IsaacMoris B Oct. 22, 2023, 11:30 a.m. OK GNU C++14 TESTS 63 265 15667200
229240570 harinboy B Oct. 22, 2023, 11:50 a.m. OK GNU C++14 TESTS 63 265 15667200
229260683 amirhoseinfar1385 B Oct. 22, 2023, 12:21 p.m. OK GNU C++17 TESTS 63 218 17817600
229242681 lddlinan B Oct. 22, 2023, 11:53 a.m. OK GNU C++17 TESTS 63 218 19763200
229231218 crazy_sea B Oct. 22, 2023, 11:37 a.m. OK GNU C++17 TESTS 63 218 35635200
229240102 marat.snowbear B Oct. 22, 2023, 11:50 a.m. OK GNU C++17 TESTS 63 233 13107200
229245043 mumu. B Oct. 22, 2023, 11:57 a.m. OK GNU C++17 TESTS 63 234 15462400
229327628 ODD-EYES B Oct. 22, 2023, 6:07 p.m. OK GNU C++17 TESTS 63 249 14540800
229340764 MASTER_MOUF B Oct. 22, 2023, 8:23 p.m. OK GNU C++17 TESTS 63 249 14540800
229239160 mickey080929 B Oct. 22, 2023, 11:48 a.m. OK GNU C++17 TESTS 63 249 16486400
229242627 Aldas25 B Oct. 22, 2023, 11:53 a.m. OK GNU C++17 TESTS 63 249 26624000
229247409 StarSilk B Oct. 22, 2023, 12:01 p.m. OK GNU C++17 TESTS 63 249 29593600
229228096 QAQAutoMaton B Oct. 22, 2023, 11:33 a.m. OK GNU C++17 (64) TESTS 63 155 23040000
229239440 hydro-bot3 B Oct. 22, 2023, 11:49 a.m. OK GNU C++17 (64) TESTS 63 170 24473600
229359718 YocyCraft B Oct. 23, 2023, 2:02 a.m. OK GNU C++17 (64) TESTS 63 217 19763200
229264064 QMG_link B Oct. 22, 2023, 12:27 p.m. OK GNU C++17 (64) TESTS 63 218 17715200
229262670 KKT_89 B Oct. 22, 2023, 12:24 p.m. OK GNU C++17 (64) TESTS 63 233 19865600
229313009 YeongTree B Oct. 22, 2023, 4 p.m. OK GNU C++17 (64) TESTS 63 233 20582400
229239211 natsugiri B Oct. 22, 2023, 11:48 a.m. OK GNU C++17 (64) TESTS 63 233 21299200
229358879 luanmenglei B Oct. 23, 2023, 1:45 a.m. OK GNU C++17 (64) TESTS 63 233 21401600
229236791 K-H B Oct. 22, 2023, 11:45 a.m. OK GNU C++17 (64) TESTS 63 233 22016000
229231115 heno239 B Oct. 22, 2023, 11:37 a.m. OK GNU C++17 (64) TESTS 63 233 28262400
229227598 maspy B Oct. 22, 2023, 11:33 a.m. OK GNU C++20 (64) TESTS 63 124 18739200
229234557 servants B Oct. 22, 2023, 11:42 a.m. OK GNU C++20 (64) TESTS 63 124 111411200
229239419 Sol1 B Oct. 22, 2023, 11:49 a.m. OK GNU C++20 (64) TESTS 63 155 23552000
229278392 c1120231020 B Oct. 22, 2023, 12:50 p.m. OK GNU C++20 (64) TESTS 63 155 40345600
229297939 GrishaIvanenko B Oct. 22, 2023, 2:11 p.m. OK GNU C++20 (64) TESTS 63 156 19456000
229361177 neal B Oct. 23, 2023, 2:32 a.m. OK GNU C++20 (64) TESTS 63 171 15257600
229339363 ecnerwala B Oct. 22, 2023, 8:06 p.m. OK GNU C++20 (64) TESTS 63 171 22630400
229339262 ecnerwala B Oct. 22, 2023, 8:05 p.m. OK GNU C++20 (64) TESTS 63 171 22630400
229250792 shobonvip B Oct. 22, 2023, 12:06 p.m. OK GNU C++20 (64) TESTS 63 171 26521600
229255008 afuafu B Oct. 22, 2023, 12:12 p.m. OK GNU C++20 (64) TESTS 63 171 41062400
229221647 FastFreeTask B Oct. 22, 2023, 11:25 a.m. OK Kotlin 1.6 TESTS 63 810 68812800
229253725 Tlatoani B Oct. 22, 2023, 12:10 p.m. OK Kotlin 1.6 TESTS 63 1465 68608000
229239342 misorin B Oct. 22, 2023, 11:49 a.m. OK PyPy 3-64 TESTS 63 561 68403200
229230070 sansen B Oct. 22, 2023, 11:36 a.m. OK Rust 2021 TESTS 63 155 44236800
229316360 0npata B Oct. 22, 2023, 4:28 p.m. OK Rust 2021 TESTS 63 280 87040000
229267086 apilat B Oct. 22, 2023, 12:31 p.m. OK Rust 2021 TESTS 63 327 66662400

remove filters

Back to search problems