Codeforces Round 594 (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
1248 Codeforces Round 594 (Div. 2) FINISHED False 7200 165876887 Oct. 20, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17050 ) B Grow The Tree PROGRAMMING greedy math sortings 900

B"Gardener Alexey teaches competitive programming to high school students. To congratulate Alexey on the Teacher's Day, the students have gifted him a collection of wooden sticks, where every stick has an integer length. Now Alexey wants to grow a tree from them. The tree looks like a polyline on the plane, consisting of all sticks. The polyline starts at the point (0, 0) . While constructing the polyline, Alexey will attach sticks to it one by one in arbitrary order. Each stick must be either vertical or horizontal (that is, parallel to OX or OY axis). It is not allowed for two consecutive sticks to be aligned simultaneously horizontally or simultaneously vertically. See the images below for clarification. Alexey wants to make a polyline in such a way that its end is as far as possible from (0, 0) . Please help him to grow the tree this way. Note that the polyline defining the form of the tree may have self-intersections and self-touches, but it can be proved that the optimal answer does not contain any self-intersections or self-touches. The first line contains an integer n ( 1 <= n <= 100 ,000 ) -- the number of sticks Alexey got as a present. The second line contains n integers a_1, ldots, a_n ( 1 <= a_i <= 10 ,000 ) -- the lengths of the sticks. Print one integer -- the square of the largest possible distance from (0, 0) to the tree end. The following pictures show optimal trees for example tests. The squared distance in the first example equals 5 cdot 5 + 1 cdot 1 = 26 , and in the second example 4 cdot 4 + 2 cdot 2 = 20 . "...

Tutorials

Editorial of Codeforces Round #594 (on the problems of Moscow Team Olympiad)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
63090467 saee B Oct. 21, 2019, 6:14 p.m. OK Clang++17 Diagnostics TESTS 41 124 0 900
63131309 venkatasaisukumar222 B Oct. 22, 2019, 2:18 p.m. OK Clang++17 Diagnostics TESTS 41 451 1126400 900
67279172 Dariush_M B Dec. 20, 2019, 12:37 p.m. OK Clang++17 Diagnostics TESTS 41 467 409600 900
62983699 daut-dlang B Oct. 20, 2019, 9:21 a.m. OK D TESTS 41 62 4198400 900
64754421 ruban B Nov. 12, 2019, 4:23 p.m. OK Delphi TESTS 41 77 62668800 900
66499525 Arcors B Dec. 8, 2019, 11:57 a.m. OK FPC TESTS 41 46 0 900
63061067 AronDarkovich B Oct. 21, 2019, 8:41 a.m. OK FPC TESTS 41 46 0 900
63061408 Kultur4ina B Oct. 21, 2019, 8:49 a.m. OK FPC TESTS 41 46 204800 900
63032091 romanporsh B Oct. 20, 2019, 6:53 p.m. OK FPC TESTS 41 46 819200 900
63003048 melery_kin B Oct. 20, 2019, 10:40 a.m. OK FPC TESTS 41 46 1024000 900
62998166 hengxin11111jy B Oct. 20, 2019, 10:16 a.m. OK FPC TESTS 41 61 409600 900
62985869 Fidisk B Oct. 20, 2019, 9:26 a.m. OK FPC TESTS 41 61 409600 900
62992376 AlifSaddid B Oct. 20, 2019, 9:48 a.m. OK FPC TESTS 41 390 4403200 900
62986455 Exploud B Oct. 20, 2019, 9:27 a.m. OK GNU C11 TESTS 41 31 0 900
66486585 yigezhe B Dec. 8, 2019, 6:41 a.m. OK GNU C11 TESTS 41 31 0 900
63277290 vjudge4 B Oct. 24, 2019, 7:22 a.m. OK GNU C11 TESTS 41 46 102400 900
63214805 Shuns B Oct. 23, 2019, 5:39 a.m. OK GNU C11 TESTS 41 46 102400 900
65671993 roy3 B Nov. 24, 2019, 4:21 p.m. OK GNU C11 TESTS 41 46 409600 900
67472639 fenofista B Dec. 23, 2019, 1:18 p.m. OK GNU C11 TESTS 41 46 409600 900
63287525 alavrentiev B Oct. 24, 2019, 10:49 a.m. OK GNU C11 TESTS 41 46 409600 900
65350340 _Tom_ B Nov. 19, 2019, 2:09 p.m. OK GNU C11 TESTS 41 46 409600 900
65525694 luogu_bot3 B Nov. 22, 2019, 10:17 a.m. OK GNU C11 TESTS 41 46 409600 900
65617404 rahulgoel B Nov. 24, 2019, 4:34 a.m. OK GNU C11 TESTS 41 46 409600 900
63074796 vjudge2 B Oct. 21, 2019, 1:24 p.m. OK GNU C++11 TESTS 41 31 204800 900
62990521 bei_li B Oct. 20, 2019, 9:41 a.m. OK GNU C++11 TESTS 41 31 204800 900
64055638 Q612 B Nov. 2, 2019, 1:14 a.m. OK GNU C++11 TESTS 41 31 204800 900
65246700 luogu_bot5 B Nov. 17, 2019, 10:40 a.m. OK GNU C++11 TESTS 41 31 204800 900
62981690 Imakf B Oct. 20, 2019, 9:17 a.m. OK GNU C++11 TESTS 41 31 204800 900
62986091 z7z_Eta B Oct. 20, 2019, 9:26 a.m. OK GNU C++11 TESTS 41 31 204800 900
63067392 oldherd B Oct. 21, 2019, 11:20 a.m. OK GNU C++11 TESTS 41 31 307200 900
63104467 fnoigsh B Oct. 22, 2019, 3:33 a.m. OK GNU C++11 TESTS 41 31 307200 900
65793266 Adelard B Nov. 27, 2019, 1:23 a.m. OK GNU C++11 TESTS 41 31 409600 900
69186207 lzr_010506 B Jan. 20, 2020, 12:02 p.m. OK GNU C++11 TESTS 41 31 409600 900
62980468 KaguraNana B Oct. 20, 2019, 9:15 a.m. OK GNU C++14 TESTS 41 31 512000 900
62980955 BeNoble B Oct. 20, 2019, 9:16 a.m. OK GNU C++14 TESTS 41 31 512000 900
63088766 riadspartanbd B Oct. 21, 2019, 5:33 p.m. OK GNU C++14 TESTS 41 31 1126400 900
62983332 qq574118090 B Oct. 20, 2019, 9:20 a.m. OK GNU C++14 TESTS 41 31 1638400 900
68775245 jrguyyoo B Jan. 14, 2020, 1:13 p.m. OK GNU C++14 TESTS 41 46 409600 900
69689202 xpov1LL B Jan. 28, 2020, 6:02 p.m. OK GNU C++14 TESTS 41 46 409600 900
69341313 Gor1ch B Jan. 22, 2020, 3:33 p.m. OK GNU C++14 TESTS 41 46 409600 900
69084985 spookywooky B Jan. 19, 2020, 7:57 a.m. OK GNU C++14 TESTS 41 46 409600 900
68977652 preda2or B Jan. 17, 2020, 9:27 a.m. OK GNU C++14 TESTS 41 46 409600 900
68333024 harshitmadaan B Jan. 6, 2020, 7:50 p.m. OK GNU C++14 TESTS 41 46 409600 900
65258694 ioyeoa B Nov. 17, 2019, 2:17 p.m. OK GNU C++17 TESTS 41 31 409600 900
63721071 Wilderzzz B Oct. 29, 2019, 11:23 a.m. OK GNU C++17 TESTS 41 31 409600 900
63103711 9957 B Oct. 22, 2019, 2:57 a.m. OK GNU C++17 TESTS 41 31 409600 900
63069900 zhouz1 B Oct. 21, 2019, 12:05 p.m. OK GNU C++17 TESTS 41 31 512000 900
65692303 JeuneEncore B Nov. 25, 2019, 5:48 a.m. OK GNU C++17 TESTS 41 31 614400 900
63958971 ryo1126 B Nov. 1, 2019, 3:56 a.m. OK GNU C++17 TESTS 41 46 102400 900
62983146 dimavaleriu B Oct. 20, 2019, 9:20 a.m. OK GNU C++17 TESTS 41 46 204800 900
69454127 AfromanLecouche B Jan. 24, 2020, 7:44 a.m. OK GNU C++17 TESTS 41 46 409600 900
69872770 Thallium_is_Vegetable B Jan. 31, 2020, 1:41 a.m. OK GNU C++17 TESTS 41 46 409600 900
69822678 Nitesh612 B Jan. 30, 2020, 8:20 a.m. OK GNU C++17 TESTS 41 46 409600 900
62987758 reanimatorzon B Oct. 20, 2019, 9:31 a.m. OK Go TESTS 41 46 0 900
68389472 ktateish B Jan. 8, 2020, 7:54 a.m. OK Go TESTS 41 61 0 900
62986199 maguroguma B Oct. 20, 2019, 9:26 a.m. OK Go TESTS 41 62 0 900
62993007 z20124528 B Oct. 20, 2019, 9:51 a.m. OK Go TESTS 41 93 0 900
62987198 cojna B Oct. 20, 2019, 9:29 a.m. OK Haskell TESTS 41 124 4300800 900
62984897 torus711 B Oct. 20, 2019, 9:23 a.m. OK Haskell TESTS 41 140 7475200 900
66565094 XOR-star B Dec. 9, 2019, 9:20 p.m. OK Haskell TESTS 41 312 14745600 900
67009908 satya_p54 B Dec. 16, 2019, 9:27 a.m. OK Java 11 TESTS 41 187 0 900
64176492 asafiul B Nov. 3, 2019, 9:12 p.m. OK Java 11 TESTS 41 202 0 900
64743157 Captain_7 B Nov. 12, 2019, 12:39 p.m. OK Java 11 TESTS 41 233 0 900
69086784 aneri B Jan. 19, 2020, 8:37 a.m. OK Java 11 TESTS 41 295 204800 900
63123970 DZY666 B Oct. 22, 2019, 12:15 p.m. OK Java 11 TESTS 41 296 204800 900
65886292 lets.see B Nov. 27, 2019, 10:43 p.m. OK Java 11 TESTS 41 311 204800 900
64195533 ZZZXXXCCCWXY999 B Nov. 4, 2019, 9:31 a.m. OK Java 11 TESTS 41 311 307200 900
65603306 HelenDyu B Nov. 23, 2019, 7:11 p.m. OK Java 11 TESTS 41 326 204800 900
63946053 dudo48 B Oct. 31, 2019, 7 p.m. OK Java 11 TESTS 41 327 307200 900
68079975 Vanquish23 B Jan. 2, 2020, 2 p.m. OK Java 11 TESTS 41 342 102400 900
67451487 Vatsal53 B Dec. 23, 2019, 4:33 a.m. OK Java 8 TESTS 41 124 0 900
64431568 navneet3dv B Nov. 6, 2019, 9:37 p.m. OK Java 8 TESTS 41 124 0 900
63941432 Mann_27__ B Oct. 31, 2019, 5:35 p.m. OK Java 8 TESTS 41 124 0 900
63093607 omargho B Oct. 21, 2019, 7:31 p.m. OK Java 8 TESTS 41 124 0 900
63093125 omargho B Oct. 21, 2019, 7:18 p.m. OK Java 8 TESTS 41 124 0 900
63092210 Anonymous B Oct. 21, 2019, 6:55 p.m. OK Java 8 TESTS 41 124 0 900
63058862 sancode B Oct. 21, 2019, 7:44 a.m. OK Java 8 TESTS 41 124 0 900
63033538 wabadabakalakaboo B Oct. 20, 2019, 7:33 p.m. OK Java 8 TESTS 41 124 0 900
63032802 prichuda B Oct. 20, 2019, 7:13 p.m. OK Java 8 TESTS 41 124 0 900
63014449 abdelrahman.ismail B Oct. 20, 2019, 12:31 p.m. OK Java 8 TESTS 41 124 0 900
68302286 I.A.K.O.V B Jan. 6, 2020, 7:18 a.m. OK Kotlin TESTS 41 139 0 900
68302336 I.A.K.O.V B Jan. 6, 2020, 7:19 a.m. OK Kotlin TESTS 41 140 0 900
68302470 I.A.K.O.V B Jan. 6, 2020, 7:24 a.m. OK Kotlin TESTS 41 155 0 900
62982670 Spheniscine B Oct. 20, 2019, 9:19 a.m. OK Kotlin TESTS 41 187 1433600 900
68846380 abdurauf1997 B Jan. 15, 2020, 7:33 a.m. OK Kotlin TESTS 41 248 4608000 900
63897315 mendel_vv B Oct. 31, 2019, 2:57 a.m. OK Kotlin TESTS 41 248 5632000 900
68875005 AsuraPro B Jan. 15, 2020, 4:36 p.m. OK Kotlin TESTS 41 249 6144000 900
62986291 david_varela B Oct. 20, 2019, 9:27 a.m. OK Kotlin TESTS 41 264 5632000 900
62996353 sainageswar B Oct. 20, 2019, 10:07 a.m. OK Kotlin TESTS 41 280 5632000 900
62987628 pavlo.liapota B Oct. 20, 2019, 9:30 a.m. OK Kotlin TESTS 41 280 5632000 900
63094279 hloya B Oct. 21, 2019, 7:47 p.m. OK Mono C# TESTS 41 77 6348800 900
63241612 Tan42 B Oct. 23, 2019, 1:36 p.m. OK Mono C# TESTS 41 78 6758400 900
64716731 Nonos B Nov. 11, 2019, 10:49 p.m. OK Mono C# TESTS 41 92 7987200 900
62989625 phanta_stick B Oct. 20, 2019, 9:37 a.m. OK Mono C# TESTS 41 92 11366400 900
63108919 GusztavSzmolik B Oct. 22, 2019, 6:30 a.m. OK Mono C# TESTS 41 93 6553600 900
63022777 TRR B Oct. 20, 2019, 3:10 p.m. OK Mono C# TESTS 41 93 6656000 900
62989699 vitaly_megabyte B Oct. 20, 2019, 9:37 a.m. OK Mono C# TESTS 41 93 6758400 900
63071226 treasuryonly B Oct. 21, 2019, 12:26 p.m. OK Mono C# TESTS 41 93 6758400 900
62981403 omikad B Oct. 20, 2019, 9:16 a.m. OK Mono C# TESTS 41 93 7168000 900
69575943 margarita.mikaelyan B Jan. 26, 2020, 3:35 p.m. OK Mono C# TESTS 41 93 8396800 900
66398301 vjudge5 B Dec. 6, 2019, 11:32 a.m. OK MS C++ TESTS 41 31 409600 900
63003318 yzhyzh B Oct. 20, 2019, 10:41 a.m. OK MS C++ TESTS 41 31 409600 900
63062773 vjudge5 B Oct. 21, 2019, 9:25 a.m. OK MS C++ TESTS 41 31 409600 900
63420338 vjudge1 B Oct. 26, 2019, 6:10 a.m. OK MS C++ TESTS 41 31 409600 900
63697961 vjudge4 B Oct. 29, 2019, 6:14 a.m. OK MS C++ TESTS 41 31 409600 900
63377028 vjudge2 B Oct. 25, 2019, 11:21 a.m. OK MS C++ TESTS 41 31 819200 900
64296488 vjudge5 B Nov. 5, 2019, 8:45 a.m. OK MS C++ TESTS 41 31 819200 900
63075110 vjudge2 B Oct. 21, 2019, 1:29 p.m. OK MS C++ TESTS 41 31 3993600 900
63129926 vjudge3 B Oct. 22, 2019, 1:53 p.m. OK MS C++ TESTS 41 31 3993600 900
66439107 vjudge3 B Dec. 7, 2019, 7:20 a.m. OK MS C++ TESTS 41 46 409600 900
69217303 vjudge4 B Jan. 21, 2020, 2:02 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
66397142 vjudge4 B Dec. 6, 2019, 11:11 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
64561238 vjudge2 B Nov. 9, 2019, 6:07 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
64561164 vjudge3 B Nov. 9, 2019, 6:06 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
64560497 vjudge5 B Nov. 9, 2019, 5:51 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
63781865 cheng222 B Oct. 30, 2019, 11:16 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
63615853 von6yka B Oct. 27, 2019, 7:26 p.m. OK MS C++ 2017 TESTS 41 46 409600 900
63519171 GomBu B Oct. 27, 2019, 2:47 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
62994113 wust_mengzhennan B Oct. 20, 2019, 9:56 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
62986847 succ1815406055 B Oct. 20, 2019, 9:28 a.m. OK MS C++ 2017 TESTS 41 46 409600 900
62992266 PAG B Oct. 20, 2019, 9:48 a.m. OK PascalABC.NET TESTS 41 280 0 900
62982011 rsFalse B Oct. 20, 2019, 9:17 a.m. OK Perl TESTS 41 233 18739200 900
64543691 mayakin B Nov. 8, 2019, 7:34 p.m. OK PHP TESTS 41 109 7987200 900
62984324 8e7 B Oct. 20, 2019, 9:22 a.m. OK PyPy 2 TESTS 41 140 6553600 900
62985278 zaceleiseliakai B Oct. 20, 2019, 9:24 a.m. OK PyPy 2 TESTS 41 155 5836800 900
62986240 _kawaii_neko_ B Oct. 20, 2019, 9:26 a.m. OK PyPy 2 TESTS 41 155 6451200 900
62985613 not_original B Oct. 20, 2019, 9:25 a.m. OK PyPy 2 TESTS 41 155 6451200 900
62984510 Mukundan314 B Oct. 20, 2019, 9:23 a.m. OK PyPy 2 TESTS 41 186 6041600 900
65753618 Gaurav1 B Nov. 26, 2019, 2:04 p.m. OK PyPy 2 TESTS 41 187 7372800 900
62987065 injust B Oct. 20, 2019, 9:29 a.m. OK PyPy 2 TESTS 41 187 7680000 900
62987015 iamprayush B Oct. 20, 2019, 9:29 a.m. OK PyPy 2 TESTS 41 218 8908800 900
62984885 H4Wk3ye B Oct. 20, 2019, 9:23 a.m. OK PyPy 3 TESTS 41 171 9420800 900
64426802 zgonnikov B Nov. 6, 2019, 7:29 p.m. OK PyPy 3 TESTS 41 186 10547200 900
66209116 llllxxx666888 B Dec. 3, 2019, 5:36 a.m. OK PyPy 3 TESTS 41 187 10342400 900
65563599 sanjailal4 B Nov. 23, 2019, 4:41 a.m. OK PyPy 3 TESTS 41 187 10342400 900
63786878 belphegor666 B Oct. 30, 2019, 12:34 p.m. OK PyPy 3 TESTS 41 187 10342400 900
68352085 vyom_goel B Jan. 7, 2020, 10:21 a.m. OK PyPy 3 TESTS 41 187 10444800 900
66433433 Lanhsi B Dec. 7, 2019, 4:49 a.m. OK PyPy 3 TESTS 41 187 10444800 900
63878096 139pavlusha B Oct. 30, 2019, 7:42 p.m. OK PyPy 3 TESTS 41 187 10444800 900
66272429 sruthi_1729 B Dec. 4, 2019, 12:46 p.m. OK PyPy 3 TESTS 41 187 10547200 900
62983862 su565fx B Oct. 20, 2019, 9:21 a.m. OK PyPy 3 TESTS 41 202 8806400 900
66306349 neuhq_haha B Dec. 5, 2019, 9:32 a.m. OK Python 2 TESTS 41 234 5632000 900
63212859 Madhur1906 B Oct. 23, 2019, 4:49 a.m. OK Python 2 TESTS 41 234 5632000 900
63241631 bhishma B Oct. 23, 2019, 1:36 p.m. OK Python 2 TESTS 41 248 5632000 900
63363327 aaa_bbb_ccc B Oct. 25, 2019, 6:34 a.m. OK Python 2 TESTS 41 249 5632000 900
66289847 HolyMoly B Dec. 4, 2019, 9:33 p.m. OK Python 2 TESTS 41 264 5632000 900
63005141 coderbd B Oct. 20, 2019, 10:50 a.m. OK Python 2 TESTS 41 265 5632000 900
63016073 timaktimak B Oct. 20, 2019, 12:56 p.m. OK Python 2 TESTS 41 265 7475200 900
64024236 kalrover B Nov. 1, 2019, 3:48 p.m. OK Python 2 TESTS 41 280 5632000 900
63015990 anshuman16423 B Oct. 20, 2019, 12:55 p.m. OK Python 2 TESTS 41 280 5632000 900
62981202 bl4ckc4t B Oct. 20, 2019, 9:16 a.m. OK Python 2 TESTS 41 280 5632000 900
65897728 _viru_ B Nov. 28, 2019, 7:08 a.m. OK Python 3 TESTS 41 139 7680000 900
69232011 8055 B Jan. 21, 2020, 9:51 a.m. OK Python 3 TESTS 41 140 6963200 900
69664556 chauhan002 B Jan. 28, 2020, 10:49 a.m. OK Python 3 TESTS 41 140 7372800 900
67773114 linananana B Dec. 28, 2019, 7:43 a.m. OK Python 3 TESTS 41 140 7372800 900
63011813 brezhart B Oct. 20, 2019, 11:54 a.m. OK Python 3 TESTS 41 140 7475200 900
64698547 Harja B Nov. 11, 2019, 2:05 p.m. OK Python 3 TESTS 41 140 7680000 900
63341417 a_z_i_b_f B Oct. 24, 2019, 5:46 p.m. OK Python 3 TESTS 41 140 7680000 900
63011423 essi B Oct. 20, 2019, 11:50 a.m. OK Python 3 TESTS 41 140 7680000 900
67569098 NiwaP B Dec. 24, 2019, 8:50 p.m. OK Python 3 TESTS 41 155 6860800 900
62984415 grigory51 B Oct. 20, 2019, 9:22 a.m. OK Python 3 TESTS 41 155 7065600 900
62985307 rinzu B Oct. 20, 2019, 9:24 a.m. OK Ruby TESTS 41 155 10035200 900
64111164 tpoeiras B Nov. 2, 2019, 6:43 p.m. OK Rust TESTS 41 31 3174400 900
62985135 terraformer B Oct. 20, 2019, 9:24 a.m. OK Rust TESTS 41 46 2969600 900
62993394 BetBit B Oct. 20, 2019, 9:52 a.m. OK Rust TESTS 41 46 3174400 900
62983884 koka831 B Oct. 20, 2019, 9:21 a.m. OK Rust TESTS 41 46 3174400 900
63781044 sophiya.ruban B Oct. 30, 2019, 11:03 a.m. OK Scala TESTS 41 592 6348800 900

remove filters

Back to search problems