Mail.Ru Cup 2018 Round 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
1056 Mail.Ru Cup 2018 Round 3 FINISHED False 9000 194275487 Nov. 25, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6044 ) D Decorate Apple Tree PROGRAMMING constructive algorithms dfs and similar dp graphs greedy sortings trees 1600

B"There is one apple tree in Arkady's garden. It can be represented as a set of junctions connected with branches so that there is only one way to reach any junctions from any other one using branches. The junctions are enumerated from 1 to n , the junction 1 is called the root. A subtree of a junction v is a set of junctions u such that the path from u to the root must pass through v . Note that v itself is included in a subtree of v . A leaf is such a junction that its subtree contains exactly one junction. The New Year is coming, so Arkady wants to decorate the tree. He will put a light bulb of some color on each leaf junction and then count the number happy junctions. A happy junction is such a junction t that all light bulbs in the subtree of t have different colors. Arkady is interested in the following question: for each k from 1 to n , what is the minimum number of different colors needed to make the number of happy junctions be greater than or equal to k ? The first line contains a single integer n ( 1 <= n <= 10^5 ) -- the number of junctions in the tree. The second line contains n - 1 integers p_2 , p_3 , ..., p_n ( 1 <= p_i < i ), where p_i means there is a branch between junctions i and p_i . It is guaranteed that this set of branches forms a tree. Output n integers. The i -th of them should be the minimum number of colors needed to make the number of happy junctions be at least i . In the first example for k = 1 and k = 2 we can use only one color: the junctions 2 and 3 will be happy. For k = 3 you have to put the bulbs of different colors to make all the junctions happy. In the second example for k = 4 you can, for example, put the bulbs of color 1 in junctions 2 and 4 , and a bulb of color 2 into junction 5 . The happy junc"...

Tutorials

Mail.Ru Cup 2018 Round 3 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
54361752 armoking D May 18, 2019, 9:14 p.m. OK Delphi TESTS 17 62 4608000 1600
46229161 ruban D Nov. 25, 2018, 7:59 p.m. OK Delphi TESTS 17 109 144486400 1600
46994793 Khanh_Moriaty D Dec. 14, 2018, 7:42 a.m. OK FPC TESTS 17 311 3993600 1600
54360783 armoking D May 18, 2019, 8:29 p.m. OK FPC TESTS 17 327 5222400 1600
62765598 lioooo0000 D Oct. 17, 2019, 8:31 a.m. OK FPC TESTS 17 327 23040000 1600
62767388 HVP.exe D Oct. 17, 2019, 9:06 a.m. OK FPC TESTS 17 342 7065600 1600
46218759 EgorShibaev D Nov. 25, 2018, 5:40 p.m. OK FPC TESTS 17 343 1228800 1600
46220830 LeoPro D Nov. 25, 2018, 5:59 p.m. OK FPC TESTS 17 389 22630400 1600
46230062 Sachin105 D Nov. 25, 2018, 8:18 p.m. OK GNU C11 TESTS 17 358 1638400 1600
46215717 Destinies D Nov. 25, 2018, 5:14 p.m. OK GNU C++11 TESTS 17 31 5632000 1600
46295426 LJC00118 D Nov. 28, 2018, 1:39 a.m. OK GNU C++11 TESTS 17 31 7168000 1600
46297775 LJC00118 D Nov. 28, 2018, 4:59 a.m. OK GNU C++11 TESTS 17 31 7168000 1600
47319080 great_influence HirasawaaYui D Dec. 21, 2018, 6:31 a.m. OK GNU C++11 TESTS 17 31 8806400 1600
48489058 LittleBeetle D Jan. 17, 2019, 9:49 a.m. OK GNU C++11 TESTS 17 46 614400 1600
46396948 yutaka1999 D Nov. 30, 2018, 9:58 a.m. OK GNU C++11 TESTS 17 46 614400 1600
54867197 Frame233 D May 31, 2019, 7 a.m. OK GNU C++11 TESTS 17 46 614400 1600
54324130 SoiMae D May 18, 2019, 12:58 a.m. OK GNU C++11 TESTS 17 46 819200 1600
50044702 vjudge3 D Feb. 17, 2019, 5:06 a.m. OK GNU C++11 TESTS 17 46 819200 1600
56689764 mmmod_lqs D July 8, 2019, 2:50 a.m. OK GNU C++11 TESTS 17 46 819200 1600
46228972 wleung_bvg D Nov. 25, 2018, 7:56 p.m. OK GNU C++14 TESTS 17 31 819200 1600
46231586 philologist D Nov. 25, 2018, 9:09 p.m. OK GNU C++14 TESTS 17 46 819200 1600
54533129 Dachim14 D May 23, 2019, 6:13 p.m. OK GNU C++14 TESTS 17 46 819200 1600
48071297 eidan D Jan. 7, 2019, 11:33 p.m. OK GNU C++14 TESTS 17 46 819200 1600
47533041 MAFIA_21 D Dec. 26, 2018, 9:01 p.m. OK GNU C++14 TESTS 17 46 819200 1600
46240531 JKa8neFF D Nov. 26, 2018, 7:35 a.m. OK GNU C++14 TESTS 17 46 819200 1600
46234675 apiadu D Nov. 26, 2018, 12:50 a.m. OK GNU C++14 TESTS 17 46 819200 1600
46215133 ynsm D Nov. 25, 2018, 5:10 p.m. OK GNU C++14 TESTS 17 46 819200 1600
46819739 AZ01 D Dec. 9, 2018, 2:29 p.m. OK GNU C++14 TESTS 17 46 921600 1600
46234553 gprano D Nov. 26, 2018, 12:40 a.m. OK GNU C++14 TESTS 17 46 1228800 1600
65903746 910306264 D Nov. 28, 2019, 9:56 a.m. OK GNU C++17 TESTS 17 31 5324800 1600
50047705 vjudge4 D Feb. 17, 2019, 6:49 a.m. OK GNU C++17 TESTS 17 46 819200 1600
46223589 toomas D Nov. 25, 2018, 6:26 p.m. OK GNU C++17 TESTS 17 46 819200 1600
52591648 Arpa D April 11, 2019, 6:08 a.m. OK GNU C++17 TESTS 17 46 819200 1600
46212746 SpyCheese D Nov. 25, 2018, 4:50 p.m. OK GNU C++17 TESTS 17 46 921600 1600
46295212 fengquyoumo D Nov. 28, 2018, 1:14 a.m. OK GNU C++17 TESTS 17 46 921600 1600
48094379 MADKIRUS D Jan. 8, 2019, 3:48 p.m. OK GNU C++17 TESTS 17 46 1126400 1600
46229341 kefaa D Nov. 25, 2018, 8:02 p.m. OK GNU C++17 TESTS 17 46 1228800 1600
46247648 PouyaNavid D Nov. 26, 2018, 12:22 p.m. OK GNU C++17 TESTS 17 46 1638400 1600
50044751 vjudge1 D Feb. 17, 2019, 5:08 a.m. OK GNU C++17 TESTS 17 46 1740800 1600
46218541 life_is_not_bed_of_roses D Nov. 25, 2018, 5:38 p.m. OK Go TESTS 17 140 10137600 1600
46230503 Lewin D Nov. 25, 2018, 8:30 p.m. OK Java 8 TESTS 17 124 0 1600
46229176 mmaxio D Nov. 25, 2018, 7:59 p.m. OK Java 8 TESTS 17 124 0 1600
46228887 Lewin D Nov. 25, 2018, 7:55 p.m. OK Java 8 TESTS 17 140 0 1600
46213933 ilyakor D Nov. 25, 2018, 5 p.m. OK Java 8 TESTS 17 140 0 1600
46237530 aman28rwt D Nov. 26, 2018, 4:51 a.m. OK Java 8 TESTS 17 140 4812800 1600
49941955 poketred12 D Feb. 15, 2019, 10:08 a.m. OK Java 8 TESTS 17 155 0 1600
46237525 aman28rwt D Nov. 26, 2018, 4:50 a.m. OK Java 8 TESTS 17 155 4710400 1600
46216254 uwi D Nov. 25, 2018, 5:19 p.m. OK Java 8 TESTS 17 156 0 1600
46581106 kusomushi D Dec. 4, 2018, 11:17 a.m. OK Java 8 TESTS 17 156 1536000 1600
46237634 Oopsimbad D Nov. 26, 2018, 4:57 a.m. OK Java 8 TESTS 17 171 0 1600
46564425 shaviava D Dec. 3, 2018, 9 p.m. OK Kotlin TESTS 17 217 17510400 1600
46215656 shaviava D Nov. 25, 2018, 5:14 p.m. OK Kotlin TESTS 17 218 13414400 1600
46564350 shaviava D Dec. 3, 2018, 8:56 p.m. OK Kotlin TESTS 17 248 65228800 1600
46229852 raynald D Nov. 25, 2018, 8:13 p.m. OK Kotlin TESTS 17 280 5222400 1600
46564394 shaviava D Dec. 3, 2018, 8:59 p.m. OK Kotlin TESTS 17 295 65228800 1600
46564333 shaviava D Dec. 3, 2018, 8:55 p.m. OK Kotlin TESTS 17 296 63078400 1600
46229497 alexey.enkov D Nov. 25, 2018, 8:05 p.m. OK Kotlin TESTS 17 405 98508800 1600
46231004 Anastasiya_Andreevna D Nov. 25, 2018, 8:48 p.m. OK Mono C# TESTS 17 155 24268800 1600
46223578 omikad D Nov. 25, 2018, 6:26 p.m. OK Mono C# TESTS 17 171 32460800 1600
46235718 eki D Nov. 26, 2018, 2:29 a.m. OK Mono C# TESTS 17 389 14848000 1600
46235041 Coder_D D Nov. 26, 2018, 1:27 a.m. OK Mono C# TESTS 17 389 19353600 1600
46217614 peregrinus D Nov. 25, 2018, 5:30 p.m. OK Mono C# TESTS 17 467 90316800 1600
46214363 wa1tz719 D Nov. 25, 2018, 5:04 p.m. OK MS C++ TESTS 17 61 4403200 1600
54783973 vjudge2 D May 29, 2019, 1:59 a.m. OK MS C++ TESTS 17 61 5632000 1600
52557206 vjudge1 D April 10, 2019, 8:23 a.m. OK MS C++ TESTS 17 62 5632000 1600
54784321 vjudge5 D May 29, 2019, 2:21 a.m. OK MS C++ TESTS 17 62 5632000 1600
54785391 vjudge1 D May 29, 2019, 3:22 a.m. OK MS C++ TESTS 17 62 7680000 1600
46219607 youx D Nov. 25, 2018, 5:48 p.m. OK MS C++ TESTS 17 62 9318400 1600
46218572 r57shell D Nov. 25, 2018, 5:39 p.m. OK MS C++ TESTS 17 77 6963200 1600
46468334 Houbunsha D Dec. 2, 2018, 5:40 a.m. OK MS C++ TESTS 17 77 7168000 1600
46213504 LoneFox D Nov. 25, 2018, 4:57 p.m. OK MS C++ TESTS 17 78 7168000 1600
46221709 claus_spb D Nov. 25, 2018, 6:07 p.m. OK MS C++ TESTS 17 93 6451200 1600
62639753 pmitkov D Oct. 15, 2019, 5:48 p.m. OK MS C++ 2017 TESTS 17 77 5632000 1600
54783372 lantianbaiyun D May 29, 2019, 1:13 a.m. OK MS C++ 2017 TESTS 17 140 1228800 1600
65435029 _Ani D Nov. 20, 2019, 1:09 p.m. OK MS C++ 2017 TESTS 17 155 6348800 1600
59241065 Still_Theory D Aug. 21, 2019, 7:45 p.m. OK MS C++ 2017 TESTS 17 171 10444800 1600
46231875 rsFalse D Nov. 25, 2018, 9:22 p.m. OK Perl TESTS 17 686 57036800 1600
46231607 rsFalse D Nov. 25, 2018, 9:10 p.m. OK Perl TESTS 17 998 56832000 1600
46265303 wangkan2001 D Nov. 27, 2018, 1:44 a.m. OK PyPy 2 TESTS 17 140 9216000 1600
46232775 sallyyao2001 D Nov. 25, 2018, 10:11 p.m. OK PyPy 2 TESTS 17 140 9216000 1600
46229440 c1729 D Nov. 25, 2018, 8:04 p.m. OK PyPy 2 TESTS 17 171 11264000 1600
48276134 yellowflash D Jan. 12, 2019, 5:48 a.m. OK PyPy 3 TESTS 17 233 13004800 1600
68448692 latter0206 D Jan. 9, 2020, 1:35 p.m. OK PyPy 3 TESTS 17 280 13926400 1600
46227289 111vad111 D Nov. 25, 2018, 7:01 p.m. OK PyPy 3 TESTS 17 296 11059200 1600
52809781 bupt.wc D April 16, 2019, 7:48 a.m. OK PyPy 3 TESTS 17 311 23142400 1600
46231485 chandak_vikas D Nov. 25, 2018, 9:04 p.m. OK PyPy 3 TESTS 17 358 15462400 1600
55082641 shubhankarsharma00 D June 4, 2019, 11:21 a.m. OK Python 2 TESTS 17 451 18944000 1600
46289596 Skand D Nov. 27, 2018, 6:38 p.m. OK Python 2 TESTS 17 467 18944000 1600
46220848 aconte D Nov. 25, 2018, 5:59 p.m. OK Python 3 TESTS 17 280 17100800 1600
46245554 manti98 D Nov. 26, 2018, 11:11 a.m. OK Python 3 TESTS 17 343 7270400 1600
46222817 old_boo D Nov. 25, 2018, 6:19 p.m. OK Python 3 TESTS 17 358 6758400 1600
51262119 hrustim25 D March 13, 2019, 1:47 p.m. OK Python 3 TESTS 17 374 19558400 1600
47310983 whatshisbucket D Dec. 20, 2018, 7:49 p.m. OK Python 3 TESTS 17 389 20480000 1600
46673569 online6731 D Dec. 6, 2018, 8:26 a.m. OK Python 3 TESTS 17 421 13721600 1600
47037714 Charles_Han D Dec. 15, 2018, 1:09 p.m. OK Python 3 TESTS 17 451 7884800 1600
46994915 Firepaw D Dec. 14, 2018, 7:46 a.m. OK Python 3 TESTS 17 451 21606400 1600
46230017 titia D Nov. 25, 2018, 8:17 p.m. OK Python 3 TESTS 17 452 7680000 1600
46227915 fikr D Nov. 25, 2018, 7:04 p.m. OK Python 3 TESTS 17 467 17305600 1600
46218244 limed D Nov. 25, 2018, 5:36 p.m. OK Scala TESTS 17 623 32460800 1600

remove filters

Back to search problems