Codeforces Round 617 (Div. 3)

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
1296 Codeforces Round 617 (Div. 3) FINISHED False 7200 156525911 Feb. 4, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2941 ) F Berland Beauty PROGRAMMING constructive algorithms dfs and similar greedy sortings trees 2400

B"There are n railway stations in Berland. They are connected to each other by n-1 railway sections. The railway network is connected, i.e. can be represented as an undirected tree. You have a map of that network, so for each railway section you know which stations it connects. Each of the n-1 sections has some integer value of the scenery beauty. However, these values are not marked on the map and you don't know them. All these values are from 1 to 10^6 inclusive. You asked m passengers some questions: the j -th one told you three values: You are planning to update the map and set some value f_i on each railway section -- the scenery beauty. The passengers' answers should be consistent with these values. Print any valid set of values f_1, f_2, ... , f_{n-1} , which the passengers' answer is consistent with or report that it doesn't exist. The first line contains a single integer n ( 2 <= n <= 5000 ) -- the number of railway stations in Berland. The next n-1 lines contain descriptions of the railway sections: the i -th section description is two integers x_i and y_i ( 1 <= x_i, y_i <= n, x_i ne y_i ), where x_i and y_i are the indices of the stations which are connected by the i -th railway section. All the railway sections are bidirected. Each station can be reached from any other station by the railway. The next line contains a single integer m ( 1 <= m <= 5000 ) -- the number of passengers which were asked questions. Then m lines follow, the j -th line contains three integers a_j , b_j and g_j ( 1 <= a_j, b_j <= n ; a_j ne b_j ; 1 <= g_j <= 10^6 ) -- the departure station, the arrival station and the minimum scenery beauty along his path. If there is no answer then print a single integer -1. Otherwise, print n-1 integers f_1, f_2, ... , f_{n-1} ( 1 <= f_i <= 10^6 )"...

Tutorials

Codeforces Round #617 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
70388000 ftiasch F Feb. 5, 2020, 6:19 p.m. OK D TESTS 276 295 512000 2400
70481144 pengin_2000 F Feb. 7, 2020, 5:58 a.m. OK GNU C11 TESTS 276 155 307200 2400
70352630 armoking F Feb. 5, 2020, 11:23 a.m. OK GNU C11 TESTS 276 202 716800 2400
70352482 armoking F Feb. 5, 2020, 11:21 a.m. OK GNU C11 TESTS 276 218 1024000 2400
70296366 temp06 F Feb. 4, 2020, 4:31 p.m. OK GNU C++11 TESTS 276 46 716800 2400
70404123 DXTsT F Feb. 6, 2020, 12:41 a.m. OK GNU C++11 TESTS 276 46 1024000 2400
70345146 JY_Poi F Feb. 5, 2020, 9:26 a.m. OK GNU C++11 TESTS 276 46 1638400 2400
70322907 Alan_zhou F Feb. 5, 2020, 1:44 a.m. OK GNU C++11 TESTS 276 46 7065600 2400
70549084 John_Ran F Feb. 8, 2020, 8:23 a.m. OK GNU C++11 TESTS 276 46 7987200 2400
70303281 Bragg_1 F Feb. 4, 2020, 5:18 p.m. OK GNU C++11 TESTS 276 46 53248000 2400
70334039 harshit15 F Feb. 5, 2020, 6:45 a.m. OK GNU C++11 TESTS 276 61 1228800 2400
70425675 frvdec F Feb. 6, 2020, 10:01 a.m. OK GNU C++11 TESTS 276 62 409600 2400
70298825 GoodZH F Feb. 4, 2020, 4:39 p.m. OK GNU C++11 TESTS 276 62 409600 2400
70370358 _Mizp F Feb. 5, 2020, 3:07 p.m. OK GNU C++11 TESTS 276 62 614400 2400
70299367 hoanghq2004 F Feb. 4, 2020, 4:43 p.m. OK GNU C++14 TESTS 276 46 1024000 2400
70305962 rafaelgo2 F Feb. 4, 2020, 5:51 p.m. OK GNU C++14 TESTS 276 46 1228800 2400
70447220 brunomont F Feb. 6, 2020, 3:25 p.m. OK GNU C++14 TESTS 276 46 1740800 2400
70610066 clavis1107 F Feb. 9, 2020, 8:10 a.m. OK GNU C++14 TESTS 276 46 1843200 2400
70375625 luogu_bot2 F Feb. 5, 2020, 4:17 p.m. OK GNU C++14 TESTS 276 46 7270400 2400
70319142 Gankutsuou F Feb. 4, 2020, 10:39 p.m. OK GNU C++14 TESTS 276 46 17408000 2400
70319124 Gankutsuou F Feb. 4, 2020, 10:38 p.m. OK GNU C++14 TESTS 276 46 24678400 2400
70319089 Gankutsuou F Feb. 4, 2020, 10:37 p.m. OK GNU C++14 TESTS 276 46 24678400 2400
70319014 Gankutsuou F Feb. 4, 2020, 10:33 p.m. OK GNU C++14 TESTS 276 46 24678400 2400
70438298 sg60 F Feb. 6, 2020, 1:25 p.m. OK GNU C++14 TESTS 276 61 1536000 2400
70617695 huxch135 F Feb. 9, 2020, 10:30 a.m. OK GNU C++17 TESTS 276 46 716800 2400
70376708 haruki_K F Feb. 5, 2020, 4:31 p.m. OK GNU C++17 TESTS 276 46 819200 2400
70606132 Ethylene F Feb. 9, 2020, 6:54 a.m. OK GNU C++17 TESTS 276 46 921600 2400
70330554 Leafy_ F Feb. 5, 2020, 5:48 a.m. OK GNU C++17 TESTS 276 46 921600 2400
70394164 neal F Feb. 5, 2020, 8:16 p.m. OK GNU C++17 TESTS 276 46 1024000 2400
70306474 FlowerOfSorrow F Feb. 4, 2020, 5:59 p.m. OK GNU C++17 TESTS 276 46 1228800 2400
70494340 KKJYOvO F Feb. 7, 2020, 10:03 a.m. OK GNU C++17 TESTS 276 46 1228800 2400
70340529 Ethylene F Feb. 5, 2020, 8:18 a.m. OK GNU C++17 TESTS 276 46 1638400 2400
70339180 rokaf2020 F Feb. 5, 2020, 7:59 a.m. OK GNU C++17 TESTS 276 46 1740800 2400
70326202 tute7627 F Feb. 5, 2020, 3:33 a.m. OK GNU C++17 TESTS 276 46 1843200 2400
70316937 TheSawan F Feb. 4, 2020, 9:21 p.m. OK Java 11 TESTS 276 233 0 2400
70325217 sarthakmanna F Feb. 5, 2020, 3:05 a.m. OK Java 11 TESTS 276 264 0 2400
70586867 Leewings F Feb. 8, 2020, 6:54 p.m. OK Java 11 TESTS 276 405 0 2400
70920806 Leewings F Feb. 12, 2020, 10:11 p.m. OK Java 11 TESTS 276 421 0 2400
70502083 Azakarka F Feb. 7, 2020, 12:27 p.m. OK Java 11 TESTS 276 1450 147353600 2400
70362030 potatmen F Feb. 5, 2020, 1:28 p.m. OK Java 11 TESTS 276 1590 262348800 2400
70353417 ZeyadKhattab F Feb. 5, 2020, 11:35 a.m. OK Java 11 TESTS 276 2058 0 2400
70456266 MuhammedAbdalla F Feb. 6, 2020, 5:34 p.m. OK Java 11 TESTS 276 2760 0 2400
71086683 Hexomiter F Feb. 14, 2020, 9:42 p.m. OK Java 11 TESTS 276 2885 307200 2400
70497057 Azakarka F Feb. 7, 2020, 10:55 a.m. OK Java 11 TESTS 276 2901 263168000 2400
70917121 O_E F Feb. 12, 2020, 8:14 p.m. OK Java 8 TESTS 276 171 0 2400
70790568 O_E F Feb. 11, 2020, 1:56 p.m. OK Java 8 TESTS 276 171 0 2400
70314857 Sharon F Feb. 4, 2020, 8:29 p.m. OK Java 8 TESTS 276 264 0 2400
70755583 sunnycarlos F Feb. 10, 2020, 8:53 p.m. OK Java 8 TESTS 276 265 0 2400
70595510 xiaowuc1 F Feb. 8, 2020, 11:30 p.m. OK Java 8 TESTS 276 280 0 2400
70760111 Meaf F Feb. 11, 2020, 12:34 a.m. OK Java 8 TESTS 276 390 0 2400
70392537 YahiaSherif F Feb. 5, 2020, 7:39 p.m. OK Java 8 TESTS 276 592 259788800 2400
70309944 YahiaSherif F Feb. 4, 2020, 6:54 p.m. OK Java 8 TESTS 276 608 259788800 2400
70309863 YahiaSherif F Feb. 4, 2020, 6:52 p.m. OK Java 8 TESTS 276 685 259788800 2400
70310105 YahiaSherif F Feb. 4, 2020, 6:57 p.m. OK Java 8 TESTS 276 997 259891200 2400
70378141 walborn F Feb. 5, 2020, 4:50 p.m. OK JavaScript TESTS 276 1887 24371200 2400
70776264 Spheniscine F Feb. 11, 2020, 9 a.m. OK Kotlin TESTS 276 186 1331200 2400
71001339 Spheniscine F Feb. 13, 2020, 4:15 p.m. OK Kotlin TESTS 276 187 1331200 2400
70776983 Spheniscine F Feb. 11, 2020, 9:14 a.m. OK Kotlin TESTS 276 187 1331200 2400
70790937 Spheniscine F Feb. 11, 2020, 2:02 p.m. OK Kotlin TESTS 276 202 1331200 2400
70369610 yakamoto F Feb. 5, 2020, 2:56 p.m. OK Kotlin TESTS 276 1247 819200 2400
70369139 yakamoto F Feb. 5, 2020, 2:49 p.m. OK Kotlin TESTS 276 2246 1024000 2400
70807423 badcw F Feb. 11, 2020, 6:58 p.m. OK Kotlin TESTS 276 2418 614400 2400
70468767 tarattata1 F Feb. 6, 2020, 10:03 p.m. OK MS C++ TESTS 276 46 2355200 2400
70791446 vjudge1 F Feb. 11, 2020, 2:11 p.m. OK MS C++ TESTS 276 46 46080000 2400
70468641 tarattata1 F Feb. 6, 2020, 9:58 p.m. OK MS C++ TESTS 276 61 2355200 2400
70294338 tarattata1 F Feb. 4, 2020, 4:26 p.m. OK MS C++ TESTS 276 342 110284800 2400
70609514 vjudge1 F Feb. 9, 2020, 8 a.m. OK MS C++ TESTS 276 358 614400 2400
70405540 AlexanderL F Feb. 6, 2020, 1:55 a.m. OK MS C++ 2017 TESTS 276 93 512000 2400
70388003 WLZ F Feb. 5, 2020, 6:19 p.m. OK MS C++ 2017 TESTS 276 327 1536000 2400
70610248 EatingMelonPublic F Feb. 9, 2020, 8:13 a.m. OK MS C++ 2017 TESTS 276 467 109875200 2400
70406687 CodeKillerBoot F Feb. 6, 2020, 2:44 a.m. OK MS C++ 2017 TESTS 276 529 125235200 2400
70407914 happy_cf F Feb. 6, 2020, 3:33 a.m. OK MS C++ 2017 TESTS 276 592 921600 2400
70305137 CrashMaster F Feb. 4, 2020, 5:41 p.m. OK MS C++ 2017 TESTS 276 670 512000 2400
70623014 e.m.blagov F Feb. 9, 2020, 12:14 p.m. OK MS C++ 2017 TESTS 276 764 201523200 2400
70391618 soshun F Feb. 5, 2020, 7:22 p.m. OK MS C++ 2017 TESTS 276 780 1843200 2400
70431753 omerb.zeybek F Feb. 6, 2020, 11:45 a.m. OK MS C++ 2017 TESTS 276 795 716800 2400
70384079 soshun F Feb. 5, 2020, 5:47 p.m. OK MS C++ 2017 TESTS 276 1419 1945600 2400
70323131 pajenegod F Feb. 5, 2020, 1:53 a.m. OK PyPy 2 TESTS 276 249 8089600 2400
70323048 pajenegod F Feb. 5, 2020, 1:50 a.m. OK PyPy 2 TESTS 276 374 34611200 2400
70528900 pineriver F Feb. 7, 2020, 9:06 p.m. OK PyPy 3 TESTS 276 405 9932800 2400
70438676 s34vv1nd F Feb. 6, 2020, 1:31 p.m. OK PyPy 3 TESTS 276 482 10035200 2400
70542884 indiewar F Feb. 8, 2020, 6:32 a.m. OK PyPy 3 TESTS 276 592 13107200 2400
70486485 510030805voidf F Feb. 7, 2020, 7:34 a.m. OK PyPy 3 TESTS 276 795 9932800 2400
70485917 510030805voidf F Feb. 7, 2020, 7:23 a.m. OK PyPy 3 TESTS 276 810 9932800 2400
70486307 510030805voidf F Feb. 7, 2020, 7:31 a.m. OK PyPy 3 TESTS 276 842 9932800 2400
70319539 throwawayatcoder F Feb. 4, 2020, 10:59 p.m. OK PyPy 3 TESTS 276 1231 10137600 2400
70317432 throwawayatcoder F Feb. 4, 2020, 9:34 p.m. OK PyPy 3 TESTS 276 1231 10137600 2400
70371191 shittttyyyyyy F Feb. 5, 2020, 3:18 p.m. OK PyPy 3 TESTS 276 1247 10240000 2400
70460741 aberent F Feb. 6, 2020, 6:36 p.m. OK PyPy 3 TESTS 276 1794 117248000 2400
70323134 pajenegod F Feb. 5, 2020, 1:53 a.m. OK Python 2 TESTS 276 234 2252800 2400
70302860 sansen F Feb. 4, 2020, 5:13 p.m. OK Rust TESTS 276 46 921600 2400
70517329 kobae964 F Feb. 7, 2020, 4:45 p.m. OK Rust TESTS 276 889 1024000 2400

remove filters

Back to search problems