Codeforces Round 592 (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
1244 Codeforces Round 592 (Div. 2) FINISHED False 7200 160865699 Oct. 13, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7622 ) D Paint the Tree PROGRAMMING brute force constructive algorithms dp graphs implementation trees 1700

B"You are given a tree consisting of n vertices. A tree is an undirected connected acyclic graph. You have to paint each vertex into one of three colors. For each vertex, you know the cost of painting it in every color. You have to paint the vertices so that any path consisting of exactly three distinct vertices does not contain any vertices with equal colors. In other words, let's consider all triples (x, y, z) such that x neq y, y neq z, x neq z , x is connected by an edge with y , and y is connected by an edge with z . The colours of x , y and z should be pairwise distinct. Let's call a painting which meets this condition good. You have to calculate the minimum cost of a good painting and find one of the optimal paintings. If there is no good painting, report about it. The first line contains one integer n (3 <= n <= 100 ,000) -- the number of vertices. The second line contains a sequence of integers c_{1, 1}, c_{1, 2}, ... , c_{1, n} (1 <= c_{1, i} <= 10^{9}) , where c_{1, i} is the cost of painting the i -th vertex into the first color. The third line contains a sequence of integers c_{2, 1}, c_{2, 2}, ... , c_{2, n} (1 <= c_{2, i} <= 10^{9}) , where c_{2, i} is the cost of painting the i -th vertex into the second color. The fourth line contains a sequence of integers c_{3, 1}, c_{3, 2}, ... , c_{3, n} (1 <= c_{3, i} <= 10^{9}) , where c_{3, i} is the cost of painting the i -th vertex into the third color. Then (n - 1) lines follow, each containing two integers u_j and v_j (1 <= u_j, v_j <= n, u_j neq v_j) -- the numbers of vertices connected by the j -th undirected edge. It is guaranteed that these edges denote a tree. If there is no good painting, print -1 . Otherwise, print the minimum cost of a good painting in the first line. In the second line print n integ"...

Tutorials

Codeforces Round #592 (Div. 2) Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
62684355 Pyqe D Oct. 16, 2019, 1:41 p.m. OK Clang++17 Diagnostics TESTS 65 764 13414400 1700
62522816 Antoine D Oct. 13, 2019, 4:18 p.m. OK Clang++17 Diagnostics TESTS 65 2932 67276800 1700
62843808 Sen_cdfo D Oct. 18, 2019, 4:28 a.m. OK Clang++17 Diagnostics TESTS 65 2994 29081600 1700
62529362 -LHVS- D Oct. 13, 2019, 6:36 p.m. OK Clang++17 Diagnostics TESTS 65 2995 171417600 1700
62576398 LaSWeeG D Oct. 14, 2019, 4:01 p.m. OK FPC TESTS 65 420 9318400 1700
62657381 chenyewei_1234 D Oct. 16, 2019, 2:53 a.m. OK GNU C++11 TESTS 65 61 9932800 1700
63784899 yp0416160202 D Oct. 30, 2019, 12:03 p.m. OK GNU C++11 TESTS 65 62 5529600 1700
63759708 Dream-chasing_Juvenile D Oct. 30, 2019, 2:49 a.m. OK GNU C++11 TESTS 65 62 9625600 1700
65738982 KaiserYang D Nov. 26, 2019, 9:14 a.m. OK GNU C++11 TESTS 65 62 11161600 1700
62782226 Q612 D Oct. 17, 2019, 1:14 p.m. OK GNU C++11 TESTS 65 62 12288000 1700
68469441 shengzihang D Jan. 9, 2020, 11:40 p.m. OK GNU C++11 TESTS 65 62 14028800 1700
62616036 BeNoble D Oct. 15, 2019, 11:27 a.m. OK GNU C++11 TESTS 65 62 18534400 1700
64675915 luogu_bot1 D Nov. 11, 2019, 8:01 a.m. OK GNU C++11 TESTS 65 62 18841600 1700
62537764 CYJian D Oct. 14, 2019, 12:29 a.m. OK GNU C++11 TESTS 65 62 23449600 1700
62866619 oduesp D Oct. 18, 2019, 12:26 p.m. OK GNU C++11 TESTS 65 62 26419200 1700
62604149 BeNoble D Oct. 15, 2019, 6:58 a.m. OK GNU C++14 TESTS 65 62 18534400 1700
62604112 BeNoble D Oct. 15, 2019, 6:57 a.m. OK GNU C++14 TESTS 65 62 18534400 1700
62635213 tokitsukaze D Oct. 15, 2019, 4:37 p.m. OK GNU C++14 TESTS 65 124 13312000 1700
62628101 Lezedary_sandwich D Oct. 15, 2019, 2:38 p.m. OK GNU C++14 TESTS 65 139 7782400 1700
62597876 derrickball D Oct. 15, 2019, 3:18 a.m. OK GNU C++14 TESTS 65 140 8601600 1700
62598879 HalfLife1600yrs D Oct. 15, 2019, 4:06 a.m. OK GNU C++14 TESTS 65 140 10342400 1700
62528126 HipHop D Oct. 13, 2019, 6:08 p.m. OK GNU C++14 TESTS 65 155 5427200 1700
64567419 ArwenNi D Nov. 9, 2019, 8:04 a.m. OK GNU C++14 TESTS 65 155 8499200 1700
65954425 heiheiheit D Nov. 29, 2019, 12:13 p.m. OK GNU C++14 TESTS 65 156 2867200 1700
62664676 zarathu D Oct. 16, 2019, 7:14 a.m. OK GNU C++14 TESTS 65 156 7270400 1700
62747986 pufanyi D Oct. 16, 2019, 10:57 p.m. OK GNU C++17 TESTS 65 78 17100800 1700
62567627 ioyeoa D Oct. 14, 2019, 1:37 p.m. OK GNU C++17 TESTS 65 93 6246400 1700
62540707 zzu_zero D Oct. 14, 2019, 3:10 a.m. OK GNU C++17 TESTS 65 108 40857600 1700
62778305 broken_cpu D Oct. 17, 2019, 12:16 p.m. OK GNU C++17 TESTS 65 155 2969600 1700
62560342 _Yuanshuai_ D Oct. 14, 2019, 11:47 a.m. OK GNU C++17 TESTS 65 155 3276800 1700
64479317 Peppa__Pig D Nov. 7, 2019, 3:23 p.m. OK GNU C++17 TESTS 65 155 13619200 1700
64864846 TooYoungTooSimp D Nov. 14, 2019, 5:37 a.m. OK GNU C++17 TESTS 65 156 2867200 1700
62655197 Amber30 D Oct. 16, 2019, 12:51 a.m. OK GNU C++17 TESTS 65 156 5222400 1700
62618304 aiktt D Oct. 15, 2019, 12:06 p.m. OK GNU C++17 TESTS 65 156 5632000 1700
69078528 Rahul_cpp D Jan. 19, 2020, 5:07 a.m. OK GNU C++17 TESTS 65 156 8499200 1700
62541358 synapse D Oct. 14, 2019, 3:38 a.m. OK Go TESTS 65 390 9830400 1700
62674038 z20124528 D Oct. 16, 2019, 10:51 a.m. OK Go TESTS 65 436 9830400 1700
62673111 z20124528 D Oct. 16, 2019, 10:31 a.m. OK Go TESTS 65 763 5427200 1700
64833552 qianhailong D Nov. 13, 2019, 4:02 p.m. OK Go TESTS 65 998 36556800 1700
63871302 serafimkoo D Oct. 30, 2019, 5:36 p.m. OK Java 11 TESTS 65 467 22528000 1700
64746054 1NVAL1D D Nov. 12, 2019, 1:34 p.m. OK Java 11 TESTS 65 733 112947200 1700
69488123 cribabby D Jan. 24, 2020, 8:37 p.m. OK Java 11 TESTS 65 904 92262400 1700
65881998 potatmen D Nov. 27, 2019, 7:32 p.m. OK Java 11 TESTS 65 1123 122060800 1700
64079126 DimaTomsk D Nov. 2, 2019, 9:37 a.m. OK Java 11 TESTS 65 1450 24985600 1700
62534244 uwi D Oct. 13, 2019, 9:06 p.m. OK Java 8 TESTS 65 171 0 1700
64423695 barakraganosungam D Nov. 6, 2019, 6:30 p.m. OK Java 8 TESTS 65 249 0 1700
62533475 spar5h D Oct. 13, 2019, 8:38 p.m. OK Java 8 TESTS 65 280 15872000 1700
62587542 akman10 D Oct. 14, 2019, 7:28 p.m. OK Java 8 TESTS 65 296 25804800 1700
62530591 mkagenius D Oct. 13, 2019, 7:10 p.m. OK Java 8 TESTS 65 311 10649600 1700
62545613 Shady51 D Oct. 14, 2019, 6:18 a.m. OK Java 8 TESTS 65 311 26828800 1700
62598172 chojh1222 D Oct. 15, 2019, 3:33 a.m. OK Java 8 TESTS 65 327 28160000 1700
65112202 bluesky111 D Nov. 15, 2019, 11:55 p.m. OK Java 8 TESTS 65 327 41676800 1700
62585241 YahiaSherif D Oct. 14, 2019, 6:35 p.m. OK Java 8 TESTS 65 358 17203200 1700
62664335 mufaddalnaya D Oct. 16, 2019, 7:06 a.m. OK Java 8 TESTS 65 373 56729600 1700
62686611 walborn D Oct. 16, 2019, 2:14 p.m. OK JavaScript TESTS 65 701 63590400 1700
62553643 Spheniscine D Oct. 14, 2019, 9:42 a.m. OK Kotlin TESTS 65 436 20172800 1700
66233533 Andreeha D Dec. 3, 2019, 3:18 p.m. OK Kotlin TESTS 65 1153 24678400 1700
66233335 Andreeha D Dec. 3, 2019, 3:14 p.m. OK Kotlin TESTS 65 1154 24883200 1700
62532427 omikad D Oct. 13, 2019, 8:02 p.m. OK Mono C# TESTS 65 327 42803200 1700
62531999 omikad D Oct. 13, 2019, 7:49 p.m. OK Mono C# TESTS 65 374 42803200 1700
62536082 tomomo2b2 D Oct. 13, 2019, 10:38 p.m. OK Mono C# TESTS 65 389 42496000 1700
62588963 Tan42 D Oct. 14, 2019, 8:04 p.m. OK Mono C# TESTS 65 717 35840000 1700
63075715 vjudge5 D Oct. 21, 2019, 1:39 p.m. OK MS C++ TESTS 65 109 11980800 1700
69277061 vjudge5 D Jan. 22, 2020, 3:08 a.m. OK MS C++ TESTS 65 124 7577600 1700
62896255 vjudge4 D Oct. 19, 2019, 12:18 a.m. OK MS C++ TESTS 65 124 9420800 1700
63375484 vjudge3 D Oct. 25, 2019, 10:53 a.m. OK MS C++ TESTS 65 124 12902400 1700
63785476 vjudge3 D Oct. 30, 2019, 12:12 p.m. OK MS C++ TESTS 65 140 8396800 1700
62898142 vjudge3 D Oct. 19, 2019, 2:18 a.m. OK MS C++ TESTS 65 140 8704000 1700
66235211 vjudge2 D Dec. 3, 2019, 3:53 p.m. OK MS C++ TESTS 65 140 9011200 1700
62518758 tarattata1 D Oct. 13, 2019, 3:08 p.m. OK MS C++ TESTS 65 155 6041600 1700
62909623 vjudge4 D Oct. 19, 2019, 6:54 a.m. OK MS C++ TESTS 65 155 8601600 1700
62515619 r57shell D Oct. 13, 2019, 2:19 p.m. OK MS C++ TESTS 65 155 20889600 1700
69395484 scorpiowf D Jan. 23, 2020, 6:05 a.m. OK MS C++ 2017 TESTS 65 202 3891200 1700
62539675 taekop D Oct. 14, 2019, 2:24 a.m. OK MS C++ 2017 TESTS 65 202 9216000 1700
62906685 vjudge3 D Oct. 19, 2019, 6:03 a.m. OK MS C++ 2017 TESTS 65 202 30412800 1700
62782956 RONGER D Oct. 17, 2019, 1:24 p.m. OK MS C++ 2017 TESTS 65 217 8806400 1700
62936652 YoshinariYoh D Oct. 19, 2019, 2:17 p.m. OK MS C++ 2017 TESTS 65 218 5222400 1700
62897744 vjudge4 D Oct. 19, 2019, 1:57 a.m. OK MS C++ 2017 TESTS 65 218 30924800 1700
62612131 holder94 D Oct. 15, 2019, 10:11 a.m. OK MS C++ 2017 TESTS 65 249 6860800 1700
64511872 catplatypus D Nov. 8, 2019, 9:06 a.m. OK MS C++ 2017 TESTS 65 249 8499200 1700
64511552 catplatypus D Nov. 8, 2019, 9 a.m. OK MS C++ 2017 TESTS 65 249 8704000 1700
63122532 dream_dreamer D Oct. 22, 2019, 11:47 a.m. OK MS C++ 2017 TESTS 65 249 9011200 1700
62545469 kabeer27 D Oct. 14, 2019, 6:14 a.m. OK PyPy 2 TESTS 65 421 26624000 1700
63435609 shanu_im D Oct. 26, 2019, 10:33 a.m. OK PyPy 2 TESTS 65 514 25190400 1700
64050169 yumtam D Nov. 1, 2019, 9:10 p.m. OK PyPy 2 TESTS 65 530 22630400 1700
62563609 alexwice D Oct. 14, 2019, 12:40 p.m. OK PyPy 2 TESTS 65 889 16896000 1700
62735961 nikeshthapa255 D Oct. 16, 2019, 6:22 p.m. OK PyPy 3 TESTS 65 826 24883200 1700
62563563 ethicalrushi23 D Oct. 14, 2019, 12:40 p.m. OK PyPy 3 TESTS 65 857 26112000 1700
62832113 deadguy D Oct. 17, 2019, 8:17 p.m. OK PyPy 3 TESTS 65 857 26726400 1700
62515563 cgfs10000 D Oct. 13, 2019, 2:18 p.m. OK PyPy 3 TESTS 65 857 30208000 1700
62516459 cgfs10000 D Oct. 13, 2019, 2:31 p.m. OK PyPy 3 TESTS 65 873 30412800 1700
62832689 Kirillov_Alexey D Oct. 17, 2019, 8:33 p.m. OK PyPy 3 TESTS 65 904 22425600 1700
63129456 O_Ramanujan D Oct. 22, 2019, 1:45 p.m. OK PyPy 3 TESTS 65 998 21299200 1700
62779118 roaris D Oct. 17, 2019, 12:27 p.m. OK PyPy 3 TESTS 65 1044 26112000 1700
62757951 littlewhywhat D Oct. 17, 2019, 5:39 a.m. OK PyPy 3 TESTS 65 1091 29184000 1700
62756772 littlewhywhat D Oct. 17, 2019, 5:07 a.m. OK PyPy 3 TESTS 65 1169 29491200 1700
67126523 erickjohnross D Dec. 17, 2019, 8:24 p.m. OK Python 3 TESTS 65 1029 22016000 1700
62545387 kabeer27 D Oct. 14, 2019, 6:11 a.m. OK Python 3 TESTS 65 1060 25497600 1700
63256823 kuz9 D Oct. 23, 2019, 6:31 p.m. OK Python 3 TESTS 65 1107 24473600 1700
64115873 Aloha D Nov. 2, 2019, 8:43 p.m. OK Python 3 TESTS 65 1201 26828800 1700
62518460 helloworld1101 D Oct. 13, 2019, 3:02 p.m. OK Python 3 TESTS 65 1216 30720000 1700
62546906 Coki628 D Oct. 14, 2019, 6:50 a.m. OK Python 3 TESTS 65 1232 22630400 1700
63012488 rohti100 D Oct. 20, 2019, 12:03 p.m. OK Python 3 TESTS 65 1262 27955200 1700
62843037 franckmy D Oct. 18, 2019, 4:01 a.m. OK Python 3 TESTS 65 1278 43008000 1700
62525358 amis_v D Oct. 13, 2019, 5:09 p.m. OK Python 3 TESTS 65 1279 34304000 1700
62530522 Unpossible D Oct. 13, 2019, 7:07 p.m. OK Python 3 TESTS 65 1310 23961600 1700
64790596 maxglushkov561 D Nov. 13, 2019, 11:02 a.m. OK Rust TESTS 65 78 5529600 1700
64277663 gazaan D Nov. 4, 2019, 10:48 p.m. OK Scala TESTS 65 2729 82739200 1700

remove filters

Back to search problems