Good Bye 2020

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
1466 Good Bye 2020 FINISHED False 10800 127927463 Dec. 30, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11703 ) D 13th Labour of Heracles PROGRAMMING greedy trees

B"You've probably heard about the twelve labors of Heracles, but do you have any idea about the thirteenth? It is commonly assumed it took him a dozen years to complete the twelve feats, so on average, a year to accomplish every one of them. As time flows faster these days, you have minutes rather than months to solve this task. But will you manage? In this problem, you are given a tree with n weighted vertices. A tree is a connected graph with n - 1 edges. Let us define its k -coloring as an assignment of k colors to the edges so that each edge has exactly one color assigned to it. Note that you don't have to use all k colors. A subgraph of color x consists of these edges from the original tree, which are assigned color x , and only those vertices that are adjacent to at least one such edge. So there are no vertices of degree 0 in such a subgraph. The value of a connected component is the sum of weights of its vertices. Let us define the value of a subgraph as a maximum of values of its connected components. We will assume that the value of an empty subgraph equals 0 . There is also a value of a k -coloring, which equals the sum of values of subgraphs of all k colors. Given a tree, for each k from 1 to n - 1 calculate the maximal value of a k -coloring. In the first line of input, there is a single integer t ( 1 <= q t <= q 10^5 ) denoting the number of test cases. Then t test cases follow. First line of each test case contains a single integer n ( 2 <= q n <= q 10^5 ). The second line consists of n integers w_1, w_2, ... , w_n ( 0 <= q w_i <= q 10^9 ), w_i equals the weight of i -th vertex. In each of the following n - 1 lines, there are two integers u , v ( 1 <= q u,v <= q n ) describing an edge between vertices u and v . It is guaranteed that these edges form a tree. The sum of n$$"...

Tutorials

Good Bye 2020 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
102862498 babaiserror D Dec. 30, 2020, 7:38 p.m. OK GNU C11 TESTS 26 936 1638400
102885197 fishcathu. D Dec. 31, 2020, 5:58 a.m. OK GNU C++11 TESTS 26 93 1228800
102873090 haoboy D Dec. 31, 2020, 12:04 a.m. OK GNU C++11 TESTS 26 93 4403200
102872856 thecold D Dec. 30, 2020, 11:53 p.m. OK GNU C++11 TESTS 26 109 1024000
102875179 dzyxdd D Dec. 31, 2020, 1:45 a.m. OK GNU C++11 TESTS 26 109 1843200
102883322 fishcathu. D Dec. 31, 2020, 5:26 a.m. OK GNU C++11 TESTS 26 109 2048000
102872978 wenhao801 D Dec. 30, 2020, 11:59 p.m. OK GNU C++11 TESTS 26 109 2457600
102873596 william555 D Dec. 31, 2020, 12:29 a.m. OK GNU C++11 TESTS 26 124 1740800
102853437 LengYun D Dec. 30, 2020, 5:17 p.m. OK GNU C++11 TESTS 26 124 3993600
102874657 kimyon D Dec. 31, 2020, 1:20 a.m. OK GNU C++11 TESTS 26 124 4812800
102854372 soapl D Dec. 30, 2020, 5:20 p.m. OK GNU C++11 TESTS 26 140 14028800
102879005 Kirito D Dec. 31, 2020, 3:53 a.m. OK GNU C++14 TESTS 26 217 1638400
102857116 SANJIN D Dec. 30, 2020, 5:29 p.m. OK GNU C++14 TESTS 26 217 2457600
102876802 tansongsong D Dec. 31, 2020, 2:51 a.m. OK GNU C++14 TESTS 26 217 2457600
102849646 LovelyAnQi D Dec. 30, 2020, 5:03 p.m. OK GNU C++14 TESTS 26 218 1945600
102879294 yakitori D Dec. 31, 2020, 4 a.m. OK GNU C++14 TESTS 26 233 2662400
102867760 D1703 D Dec. 30, 2020, 9:01 p.m. OK GNU C++14 TESTS 26 233 3993600
102853814 Zhaoyz D Dec. 30, 2020, 5:18 p.m. OK GNU C++14 TESTS 26 234 5427200
102871226 code_bomb D Dec. 30, 2020, 10:45 p.m. OK GNU C++14 TESTS 26 248 2252800
102879905 mesumit D Dec. 31, 2020, 4:14 a.m. OK GNU C++14 TESTS 26 249 1228800
102876959 App_Math D Dec. 31, 2020, 2:56 a.m. OK GNU C++14 TESTS 26 249 1228800
102879418 vjudge4 D Dec. 31, 2020, 4:03 a.m. OK GNU C++17 TESTS 26 124 7065600
102884416 tjd229 D Dec. 31, 2020, 5:45 a.m. OK GNU C++17 TESTS 26 187 1843200
102862924 LKSH2018 D Dec. 30, 2020, 7:45 p.m. OK GNU C++17 TESTS 26 187 4096000
102853824 zyb D Dec. 30, 2020, 5:18 p.m. OK GNU C++17 TESTS 26 202 10035200
102874043 trainerherp D Dec. 31, 2020, 12:49 a.m. OK GNU C++17 TESTS 26 218 1843200
102874432 monzaid D Dec. 31, 2020, 1:10 a.m. OK GNU C++17 TESTS 26 218 1843200
102882452 Legendary_Loser D Dec. 31, 2020, 5:10 a.m. OK GNU C++17 TESTS 26 218 4300800
102876461 zhujiahao D Dec. 31, 2020, 2:40 a.m. OK GNU C++17 TESTS 26 218 16998400
102876780 hangzai D Dec. 31, 2020, 2:50 a.m. OK GNU C++17 TESTS 26 233 819200
102876236 little_ge D Dec. 31, 2020, 2:31 a.m. OK GNU C++17 TESTS 26 233 1638400
102865636 sirearsh D Dec. 30, 2020, 8:19 p.m. OK GNU C++17 (64) TESTS 26 155 1843200
102870200 ddvddv D Dec. 30, 2020, 10:08 p.m. OK GNU C++17 (64) TESTS 26 155 1843200
102863652 Amphyx D Dec. 30, 2020, 7:53 p.m. OK GNU C++17 (64) TESTS 26 155 3788800
102866493 kaiboy D Dec. 30, 2020, 8:33 p.m. OK GNU C++17 (64) TESTS 26 156 1228800
102864803 samchen123 D Dec. 30, 2020, 8:07 p.m. OK GNU C++17 (64) TESTS 26 156 1843200
102865942 bedirhan D Dec. 30, 2020, 8:24 p.m. OK GNU C++17 (64) TESTS 26 156 1843200
102876158 InojosaCS D Dec. 31, 2020, 2:28 a.m. OK GNU C++17 (64) TESTS 26 156 2969600
102863522 smax D Dec. 30, 2020, 7:52 p.m. OK GNU C++17 (64) TESTS 26 170 1228800
102872513 sjay05 D Dec. 30, 2020, 11:38 p.m. OK GNU C++17 (64) TESTS 26 170 2252800
102848915 wronganswer D Dec. 30, 2020, 5:01 p.m. OK GNU C++17 (64) TESTS 26 170 3584000
102849421 akokoz D Dec. 30, 2020, 5:03 p.m. OK Java 11 TESTS 26 358 102400
102879000 nietzschewalrus779 D Dec. 31, 2020, 3:53 a.m. OK Java 11 TESTS 26 421 204800
102858064 ay_08 D Dec. 30, 2020, 5:32 p.m. OK Java 11 TESTS 26 436 0
102871272 Akshat1409 D Dec. 30, 2020, 10:47 p.m. OK Java 11 TESTS 26 451 0
102874105 AnythingWithJ D Dec. 31, 2020, 12:53 a.m. OK Java 11 TESTS 26 452 0
102858582 typewriter999 D Dec. 30, 2020, 5:33 p.m. OK Java 11 TESTS 26 467 0
102862930 RuthlessAggression D Dec. 30, 2020, 7:45 p.m. OK Java 11 TESTS 26 467 307200
102857732 liubenjamin D Dec. 30, 2020, 5:31 p.m. OK Java 11 TESTS 26 467 409600
102863038 destroyer57 D Dec. 30, 2020, 7:46 p.m. OK Java 11 TESTS 26 483 512000
102853394 blackBird D Dec. 30, 2020, 5:17 p.m. OK Java 11 TESTS 26 483 11161600
102873402 MubtasimShahriar D Dec. 31, 2020, 12:20 a.m. OK Java 8 TESTS 26 327 0
102861939 piyush33patel D Dec. 30, 2020, 7:35 p.m. OK Java 8 TESTS 26 343 0
102861966 manishsharmaa__ D Dec. 30, 2020, 7:35 p.m. OK Java 8 TESTS 26 389 17408000
102863511 nandit D Dec. 30, 2020, 7:52 p.m. OK Java 8 TESTS 26 436 19865600
102880420 Pranay2516 D Dec. 31, 2020, 4:27 a.m. OK Java 8 TESTS 26 482 19968000
102848580 kp_863 D Dec. 30, 2020, 5 p.m. OK Java 8 TESTS 26 561 24371200
102865674 kareem3id D Dec. 30, 2020, 8:20 p.m. OK Java 8 TESTS 26 576 16998400
102856334 martins D Dec. 30, 2020, 5:27 p.m. OK Java 8 TESTS 26 577 24780800
102862963 honeysingh18 D Dec. 30, 2020, 7:45 p.m. OK Java 8 TESTS 26 623 26419200
102866092 rachitpts.2454 D Dec. 30, 2020, 8:27 p.m. OK Java 8 TESTS 26 701 28467200
102874303 Spheniscine D Dec. 31, 2020, 1:04 a.m. OK Kotlin TESTS 26 295 7372800
102868057 BIT D Dec. 30, 2020, 9:08 p.m. OK Mono C# TESTS 26 966 21094400
102850165 P___ D Dec. 30, 2020, 5:05 p.m. OK MS C++ 2017 TESTS 26 311 6758400
102852785 wu_sir D Dec. 30, 2020, 5:15 p.m. OK MS C++ 2017 TESTS 26 561 2457600
102856464 Present D Dec. 30, 2020, 5:27 p.m. OK MS C++ 2017 TESTS 26 607 1638400
102879566 haminh0307 D Dec. 31, 2020, 4:06 a.m. OK MS C++ 2017 TESTS 26 685 819200
102854169 Alex2184 D Dec. 30, 2020, 5:19 p.m. OK MS C++ 2017 TESTS 26 873 8601600
102857455 786yashdhiman D Dec. 30, 2020, 5:30 p.m. OK PyPy 3 TESTS 26 530 46284800
102881203 DIII D Dec. 31, 2020, 4:45 a.m. OK PyPy 3 TESTS 26 685 32460800
102881010 DIII D Dec. 31, 2020, 4:41 a.m. OK PyPy 3 TESTS 26 701 40243200
102852908 acehacks D Dec. 30, 2020, 5:15 p.m. OK PyPy 3 TESTS 26 904 14028800
102862339 Purota D Dec. 30, 2020, 7:37 p.m. OK PyPy 3 TESTS 26 920 34201600
102884766 suncup224 D Dec. 31, 2020, 5:51 a.m. OK PyPy 3 TESTS 26 982 34406400
102878827 whisper0077 D Dec. 31, 2020, 3:48 a.m. OK PyPy 3 TESTS 26 1013 29900800
102863809 tdpencil D Dec. 30, 2020, 7:55 p.m. OK PyPy 3 TESTS 26 1029 28160000
102857537 Munchy_1 D Dec. 30, 2020, 5:31 p.m. OK PyPy 3 TESTS 26 1060 17817600
102863169 upadhyay.aaditya2001 D Dec. 30, 2020, 7:47 p.m. OK PyPy 3 TESTS 26 1060 20787200
102866870 ap1008 D Dec. 30, 2020, 8:40 p.m. OK Python 2 TESTS 26 1356 19456000
102865323 Kurisu__ D Dec. 30, 2020, 8:15 p.m. OK Python 3 TESTS 26 795 15462400
102880978 nicku123 D Dec. 31, 2020, 4:40 a.m. OK Python 3 TESTS 26 920 35430400
102867944 goodBye2021 D Dec. 30, 2020, 9:05 p.m. OK Python 3 TESTS 26 966 14233600
102851400 sauravbiyani D Dec. 30, 2020, 5:10 p.m. OK Python 3 TESTS 26 1388 18022400
102850469 Kunika_B D Dec. 30, 2020, 5:06 p.m. OK Python 3 TESTS 26 1528 11571200
102867628 Amrit_nand D Dec. 30, 2020, 8:58 p.m. OK Python 3 TESTS 26 1543 15667200
102849376 ojha_abhi D Dec. 30, 2020, 5:03 p.m. OK Python 3 TESTS 26 1575 18432000
102879139 sh1194 D Dec. 31, 2020, 3:56 a.m. OK Python 3 TESTS 26 1590 14233600
102885585 thErocKstaR D Dec. 31, 2020, 6:04 a.m. OK Python 3 TESTS 26 1606 11366400
102850592 QuantaCooper D Dec. 30, 2020, 5:07 p.m. OK Python 3 TESTS 26 1606 15667200
102859351 gmm_tea D Dec. 30, 2020, 5:34 p.m. OK Ruby TESTS 26 1980 28364800
102862647 gmm_tea D Dec. 30, 2020, 7:40 p.m. OK Ruby TESTS 26 2027 28979200
102862671 gmm_tea D Dec. 30, 2020, 7:40 p.m. OK Ruby TESTS 26 2028 29184000
102877427 togatoga D Dec. 31, 2020, 3:11 a.m. OK Rust TESTS 26 405 5632000

remove filters

Back to search problems