Codeforces Round 621 (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
1307 Codeforces Round 621 (Div. 1 + Div. 2) FINISHED False 8100 155399111 Feb. 17, 2020, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6520 ) D Cow and Fields PROGRAMMING binary search data structures dfs and similar graphs greedy shortest paths sortings 1900

B'Bessie is out grazing on the farm, which consists of n fields connected by m bidirectional roads. She is currently at field 1 , and will return to her home at field n at the end of the day. The Cowfederation of Barns has ordered Farmer John to install one extra bidirectional road. The farm has k special fields and he has decided to install the road between two different special fields. He may add the road between two special fields that already had a road directly connecting them. After the road is added, Bessie will return home on the shortest path from field 1 to field n . Since Bessie needs more exercise, Farmer John must maximize the length of this shortest path. Help him! The first line contains integers n , m , and k ( 2 <= n <= 2 cdot 10^5 , n-1 <= m <= 2 cdot 10^5 , 2 <= k <= n ) -- the number of fields on the farm, the number of roads, and the number of special fields. The second line contains k integers a_1, a_2, ldots, a_k ( 1 <= a_i <= n ) -- the special fields. All a_i are distinct. The i -th of the following m lines contains integers x_i and y_i ( 1 <= x_i, y_i <= n , x_i ne y_i ), representing a bidirectional road between fields x_i and y_i . It is guaranteed that one can reach any field from every other field. It is also guaranteed that for any pair of fields there is at most one road connecting them. Output one integer, the maximum possible length of the shortest path from field 1 to n after Farmer John installs one road optimally. The graph for the first example is shown below. The special fields are denoted by red. It is optimal for Farmer John to add a road between fields 3 and 5 , and the resulting shortest path from 1 to 5 is length 3 . The graph for the second example is shown below. Farmer John must add a road between fields 2 and $'...

Tutorials

Codeforces Round #621 (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
71455529 LaSWeeG D Feb. 19, 2020, 6:08 p.m. OK FPC TESTS 66 171 29081600 1900
71394302 LaSWeeG D Feb. 18, 2020, 5:22 p.m. OK FPC TESTS 66 873 23347200 1900
71502267 sheep0x D Feb. 20, 2020, 3:11 p.m. OK GNU C11 TESTS 66 155 11264000 1900
71340428 rainboy D Feb. 17, 2020, 8:29 p.m. OK GNU C11 TESTS 66 171 7270400 1900
71500998 sheep0x D Feb. 20, 2020, 2:49 p.m. OK GNU C11 TESTS 66 171 22425600 1900
71503017 sheep0x D Feb. 20, 2020, 3:25 p.m. OK GNU C11 TESTS 66 186 11264000 1900
71502332 sheep0x D Feb. 20, 2020, 3:12 p.m. OK GNU C11 TESTS 66 202 11264000 1900
71502109 sheep0x D Feb. 20, 2020, 3:08 p.m. OK GNU C11 TESTS 66 202 19251200 1900
71311362 physics0523 D Feb. 17, 2020, 4:33 p.m. OK GNU C11 TESTS 65 389 58777600 1900
71330955 pengin_2000 D Feb. 17, 2020, 5:47 p.m. OK GNU C11 TESTS 65 639 48128000 1900
71413086 ljr1234 D Feb. 19, 2020, 4:14 a.m. OK GNU C++11 TESTS 66 62 8089600 1900
71487053 nao-nao D Feb. 20, 2020, 10:30 a.m. OK GNU C++11 TESTS 66 77 18534400 1900
71305809 Binary_Search_Tree D Feb. 17, 2020, 4:16 p.m. OK GNU C++11 TESTS 65 77 32972800 1900
71582734 crashed D Feb. 22, 2020, 2:44 a.m. OK GNU C++11 TESTS 67 78 7270400 1900
71356457 pkh68 D Feb. 18, 2020, 6:10 a.m. OK GNU C++11 TESTS 66 78 7372800 1900
71327339 ChthollyNotaSeniorious D Feb. 17, 2020, 5:33 p.m. OK GNU C++11 TESTS 65 78 7372800 1900
71345364 Dilute D Feb. 17, 2020, 11:32 p.m. OK GNU C++11 TESTS 66 78 7987200 1900
71384410 Feng D Feb. 18, 2020, 2:28 p.m. OK GNU C++11 TESTS 66 78 8908800 1900
71372948 _Backl1ght D Feb. 18, 2020, 11:37 a.m. OK GNU C++11 TESTS 66 78 10240000 1900
71479913 ProgSlacking D Feb. 20, 2020, 7:57 a.m. OK GNU C++11 TESTS 66 78 11468800 1900
71479835 tsingcbx D Feb. 20, 2020, 7:55 a.m. OK GNU C++14 TESTS 66 156 8294400 1900
71349562 Zery_test D Feb. 18, 2020, 2:58 a.m. OK GNU C++14 TESTS 66 156 9113600 1900
71440984 Linkus D Feb. 19, 2020, 1:47 p.m. OK GNU C++14 TESTS 66 156 11264000 1900
71315804 tokitsukaze D Feb. 17, 2020, 4:48 p.m. OK GNU C++14 TESTS 65 156 15360000 1900
71363122 Helman D Feb. 18, 2020, 8:20 a.m. OK GNU C++14 TESTS 66 171 12902400 1900
71500819 bhasky_06 D Feb. 20, 2020, 2:46 p.m. OK GNU C++14 TESTS 66 186 12288000 1900
71349367 Jyqjyq1 D Feb. 18, 2020, 2:50 a.m. OK GNU C++14 TESTS 66 186 13312000 1900
71316705 wleung_bvg D Feb. 17, 2020, 4:51 p.m. OK GNU C++14 TESTS 65 186 14131200 1900
71350920 Ravanla D Feb. 18, 2020, 3:47 a.m. OK GNU C++14 TESTS 66 187 7270400 1900
71304840 caoyue D Feb. 17, 2020, 4:14 p.m. OK GNU C++14 TESTS 65 187 8806400 1900
71308186 Unsterblicher_Geist D Feb. 17, 2020, 4:23 p.m. OK GNU C++17 TESTS 65 92 15667200 1900
71366559 MaJorie D Feb. 18, 2020, 9:27 a.m. OK GNU C++17 TESTS 66 140 10444800 1900
71355808 haiqilai D Feb. 18, 2020, 5:56 a.m. OK GNU C++17 TESTS 66 140 11776000 1900
71334371 wawcac D Feb. 17, 2020, 6:53 p.m. OK GNU C++17 TESTS 65 155 9113600 1900
71362840 SelfStrong_SONG D Feb. 18, 2020, 8:15 a.m. OK GNU C++17 TESTS 66 155 10649600 1900
71599234 bahakz D Feb. 22, 2020, 8:48 a.m. OK GNU C++17 TESTS 67 156 9113600 1900
71642361 nitian D Feb. 23, 2020, 4:15 a.m. OK GNU C++17 TESTS 67 156 9318400 1900
71363616 xiaoxiaomo D Feb. 18, 2020, 8:31 a.m. OK GNU C++17 TESTS 66 156 11468800 1900
71349773 Magicdog_Jo D Feb. 18, 2020, 3:06 a.m. OK GNU C++17 TESTS 66 171 9318400 1900
71354284 alengbao D Feb. 18, 2020, 5:21 a.m. OK GNU C++17 TESTS 66 171 9932800 1900
71363357 wzazzy D Feb. 18, 2020, 8:25 a.m. OK Go TESTS 66 156 11776000 1900
71363751 wzazzy D Feb. 18, 2020, 8:34 a.m. OK Go TESTS 66 217 11776000 1900
71364123 wzazzy D Feb. 18, 2020, 8:42 a.m. OK Go TESTS 66 248 11776000 1900
71325825 Jughead D Feb. 17, 2020, 5:27 p.m. OK Go TESTS 65 295 9830400 1900
71345715 bleh0.5 D Feb. 17, 2020, 11:56 p.m. OK Java 11 TESTS 66 717 56729600 1900
71347023 bleh0.5 D Feb. 18, 2020, 1:15 a.m. OK Java 11 TESTS 66 779 56729600 1900
71418020 Azakarka D Feb. 19, 2020, 6:24 a.m. OK Java 11 TESTS 66 795 51814400 1900
71347041 bleh0.5 D Feb. 18, 2020, 1:15 a.m. OK Java 11 TESTS 66 795 56729600 1900
71341605 Ti4oVolchara D Feb. 17, 2020, 9 p.m. OK Java 11 TESTS 66 826 54579200 1900
71307537 Suzukaze D Feb. 17, 2020, 4:21 p.m. OK Java 11 TESTS 65 873 51302400 1900
71452188 sarthakmanna D Feb. 19, 2020, 5:05 p.m. OK Java 11 TESTS 66 888 50995200 1900
71368011 i_love_vim D Feb. 18, 2020, 9:55 a.m. OK Java 11 TESTS 66 919 72908800 1900
71310985 Dukkha D Feb. 17, 2020, 4:32 p.m. OK Java 11 TESTS 65 920 6451200 1900
71439574 Ti4oVolchara D Feb. 19, 2020, 1:26 p.m. OK Java 11 TESTS 66 920 87347200 1900
71310721 DarLam D Feb. 17, 2020, 4:31 p.m. OK Java 8 TESTS 65 342 13721600 1900
71333984 fetetriste D Feb. 17, 2020, 6:50 p.m. OK Java 8 TESTS 65 404 4300800 1900
71359919 aman28rwt D Feb. 18, 2020, 7:19 a.m. OK Java 8 TESTS 66 405 12902400 1900
71568079 prem_cse D Feb. 21, 2020, 6:01 p.m. OK Java 8 TESTS 66 514 59699200 1900
71361126 cwise D Feb. 18, 2020, 7:41 a.m. OK Java 8 TESTS 66 514 90009600 1900
71302668 Lewin D Feb. 17, 2020, 4:08 p.m. OK Java 8 TESTS 65 608 38400000 1900
71393005 an09mous D Feb. 18, 2020, 4:59 p.m. OK Java 8 TESTS 66 639 46182400 1900
71466421 surajchip2 D Feb. 20, 2020, 12:19 a.m. OK Java 8 TESTS 66 654 39321600 1900
71577983 Tomg D Feb. 21, 2020, 10:30 p.m. OK Java 8 TESTS 67 654 54886400 1900
71321360 Unum D Feb. 17, 2020, 5:09 p.m. OK Java 8 TESTS 65 654 66252800 1900
71386482 Spheniscine D Feb. 18, 2020, 3:02 p.m. OK Kotlin TESTS 66 561 33996800 1900
71386388 Spheniscine D Feb. 18, 2020, 3 p.m. OK Kotlin TESTS 66 561 33996800 1900
71386922 Spheniscine D Feb. 18, 2020, 3:08 p.m. OK Kotlin TESTS 66 576 33996800 1900
71385983 Spheniscine D Feb. 18, 2020, 2:53 p.m. OK Kotlin TESTS 66 670 41881600 1900
71462713 darnley D Feb. 19, 2020, 9:09 p.m. OK Kotlin TESTS 66 1590 72704000 1900
71462501 darnley D Feb. 19, 2020, 9:03 p.m. OK Kotlin TESTS 66 1590 72704000 1900
71311907 darnley D Feb. 17, 2020, 4:34 p.m. OK Kotlin TESTS 65 1637 83865600 1900
71338284 darnley D Feb. 17, 2020, 7:45 p.m. OK Kotlin TESTS 66 1949 87040000 1900
71328522 plasma-effect D Feb. 17, 2020, 5:38 p.m. OK Mono C# TESTS 65 701 34508800 1900
71329609 mban259 D Feb. 17, 2020, 5:43 p.m. OK Mono C# TESTS 65 888 63283200 1900
71539337 vjudge5 D Feb. 21, 2020, 9:03 a.m. OK MS C++ TESTS 66 170 29593600 1900
71329772 lxhgww D Feb. 17, 2020, 5:43 p.m. OK MS C++ TESTS 65 202 12390400 1900
71321425 baep_j D Feb. 17, 2020, 5:09 p.m. OK MS C++ TESTS 65 218 14745600 1900
71321671 tarattata1 D Feb. 17, 2020, 5:10 p.m. OK MS C++ TESTS 65 358 20070400 1900
71323741 MinhNguye D Feb. 17, 2020, 5:18 p.m. OK MS C++ TESTS 65 546 13824000 1900
71641260 wjsrptmd D Feb. 23, 2020, 3:44 a.m. OK MS C++ 2017 TESTS 67 234 10649600 1900
71641029 wjsrptmd D Feb. 23, 2020, 3:34 a.m. OK MS C++ 2017 TESTS 67 249 10649600 1900
71353207 s1mp1e D Feb. 18, 2020, 4:58 a.m. OK MS C++ 2017 TESTS 66 280 12390400 1900
71533906 2018qwer D Feb. 21, 2020, 7:18 a.m. OK MS C++ 2017 TESTS 66 295 10649600 1900
71537591 2018qwer D Feb. 21, 2020, 8:28 a.m. OK MS C++ 2017 TESTS 66 295 10649600 1900
71373180 Laaahu_ D Feb. 18, 2020, 11:40 a.m. OK MS C++ 2017 TESTS 66 296 13107200 1900
71378541 LeeLdler D Feb. 18, 2020, 1:05 p.m. OK MS C++ 2017 TESTS 66 296 14131200 1900
71312324 pichulia D Feb. 17, 2020, 4:36 p.m. OK MS C++ 2017 TESTS 65 327 13824000 1900
71385881 btwiusearch D Feb. 18, 2020, 2:52 p.m. OK MS C++ 2017 TESTS 66 358 16076800 1900
71448357 vjudge5 D Feb. 19, 2020, 3:56 p.m. OK MS C++ 2017 TESTS 66 529 8089600 1900
71342726 vjudge5 D Feb. 17, 2020, 9:34 p.m. OK PyPy 2 TESTS 66 545 37376000 1900
71342776 YESMAths D Feb. 17, 2020, 9:36 p.m. OK PyPy 2 TESTS 66 576 37376000 1900
71303712 pajenegod D Feb. 17, 2020, 4:10 p.m. OK PyPy 2 TESTS 65 779 40652800 1900
71365878 pa.n.ik D Feb. 18, 2020, 9:14 a.m. OK PyPy 2 TESTS 66 1029 34918400 1900
71566672 pa.n.ik D Feb. 21, 2020, 5:32 p.m. OK PyPy 2 TESTS 66 1044 34918400 1900
71340771 potpath D Feb. 17, 2020, 8:37 p.m. OK PyPy 2 TESTS 66 1855 59699200 1900
71317178 titia D Feb. 17, 2020, 4:52 p.m. OK PyPy 3 TESTS 65 904 28364800 1900
71432203 auouo D Feb. 19, 2020, 11:17 a.m. OK PyPy 3 TESTS 66 920 35225600 1900
71398826 siyy D Feb. 18, 2020, 6:43 p.m. OK PyPy 3 TESTS 66 950 68915200 1900
71339136 cho12 D Feb. 17, 2020, 8 p.m. OK PyPy 3 TESTS 66 1091 31436800 1900
71386572 auouo D Feb. 18, 2020, 3:03 p.m. OK PyPy 3 TESTS 66 1123 42291200 1900
71402151 brthyyjp D Feb. 18, 2020, 8 p.m. OK PyPy 3 TESTS 66 1153 39116800 1900
71494223 xiema D Feb. 20, 2020, 12:59 p.m. OK PyPy 3 TESTS 66 1201 58470400 1900
71323794 throwawayatcoder D Feb. 17, 2020, 5:19 p.m. OK PyPy 3 TESTS 65 1247 64000000 1900
71353662 Coki628 D Feb. 18, 2020, 5:08 a.m. OK PyPy 3 TESTS 66 1262 54681600 1900
71411652 nehan_der_thal D Feb. 19, 2020, 3:25 a.m. OK PyPy 3 TESTS 66 1262 73523200 1900
71340816 potpath D Feb. 17, 2020, 8:38 p.m. OK Python 3 TESTS 66 1372 52531200 1900
71370061 yh157612 D Feb. 18, 2020, 10:38 a.m. OK Python 3 TESTS 66 1512 38195200 1900
71430686 FallingStar D Feb. 19, 2020, 10:48 a.m. OK Python 3 TESTS 66 1809 43008000 1900
71430724 GuluTheFish D Feb. 19, 2020, 10:49 a.m. OK Python 3 TESTS 66 1980 44339200 1900
71309644 EbTech D Feb. 17, 2020, 4:27 p.m. OK Rust TESTS 65 140 11571200 1900
71352512 sansen D Feb. 18, 2020, 4:39 a.m. OK Rust TESTS 66 140 16998400 1900
71318014 sansen D Feb. 17, 2020, 4:56 p.m. OK Rust TESTS 65 187 22937600 1900
71336456 BadDuck D Feb. 17, 2020, 7:17 p.m. OK Scala TESTS 65 1481 57856000 1900

remove filters

Back to search problems