Codeforces Round 652 (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
1369 Codeforces Round 652 (Div. 2) FINISHED False 7200 144431711 June 23, 2020, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19793 ) C RationalLee PROGRAMMING greedy math sortings 1400

B"Lee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought n integers, now it's time to distribute them between his friends rationally... Lee has n integers a_1, a_2, ldots, a_n in his backpack and he has k friends. Lee would like to distribute all integers in his backpack between his friends, such that the i -th friend will get exactly w_i integers and each integer will be handed over to exactly one friend. Let's define the happiness of a friend as the sum of the maximum and the minimum integer he'll get. Lee would like to make his friends as happy as possible, in other words, he'd like to maximize the sum of friends' happiness. Now he asks you to calculate the maximum sum of friends' happiness. The first line contains one integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Next 3t lines contain test cases -- one per three lines. The first line of each test case contains two integers n and k ( 1 <= n <= 2 cdot 10^5 ; 1 <= k <= n ) -- the number of integers Lee has and the number of Lee's friends. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( -10^9 <= a_i <= 10^9 ) -- the integers Lee has. The third line contains k integers w_1, w_2, ldots, w_k ( 1 <= w_i <= n ; w_1 + w_2 + ldots + w_k = n ) -- the number of integers Lee wants to give to each friend. It's guaranteed that the sum of n over test cases is less than or equal to 2 cdot 10^5 . For each test case, print a single integer -- the maximum sum of happiness Lee can achieve. In the first test case, Lee should give the greatest integer to the first friend (his happiness will be 17 + 17 ) and remaining integers to the second friend (his happiness will be 13 + 1 ). In the second test case, Lee should give {10, 10, 11 } to the first friend and to the second friend,"...

Tutorials

Codeforces Round #652 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
84780310 daut-dlang C June 23, 2020, 2:40 p.m. OK D TESTS 25 140 18227200 1400
84789176 Gassa C June 23, 2020, 2:56 p.m. OK D TESTS 25 155 18227200 1400
84803708 ruban C June 23, 2020, 3:29 p.m. OK FPC TESTS 25 264 164761600 1400
84809691 SaiAryan C June 23, 2020, 3:45 p.m. OK GNU C11 TESTS 25 124 5324800 1400
84801622 anujsinghal C June 23, 2020, 3:24 p.m. OK GNU C11 TESTS 25 139 7680000 1400
84809340 rainboy C June 23, 2020, 3:44 p.m. OK GNU C11 TESTS 25 140 5529600 1400
84857410 JoseTomas01 C June 24, 2020, 5:59 a.m. OK GNU C11 TESTS 32 155 8601600 1400
84811471 magedrifaat C June 23, 2020, 3:50 p.m. OK GNU C11 TESTS 25 156 6348800 1400
84823040 shubhamar C June 23, 2020, 5:16 p.m. OK GNU C11 TESTS 25 156 6860800 1400
84797642 CaptainShammer C June 23, 2020, 3:14 p.m. OK GNU C11 TESTS 25 156 7168000 1400
84785360 ja1467 C June 23, 2020, 2:49 p.m. OK GNU C11 TESTS 25 156 8499200 1400
84804159 yhc19990202 C June 23, 2020, 3:30 p.m. OK GNU C11 TESTS 25 280 6041600 1400
84831007 Amin.s C June 23, 2020, 6:56 p.m. OK GNU C11 TESTS 25 748 7168000 1400
84789016 cjtsear C June 23, 2020, 2:56 p.m. OK GNU C++11 TESTS 25 46 5324800 1400
84856453 Clever_Jimmy C June 24, 2020, 5:45 a.m. OK GNU C++11 TESTS 32 46 5734400 1400
84844042 Bill_Benation C June 24, 2020, 12:40 a.m. OK GNU C++11 TESTS 26 46 5734400 1400
84791897 Angel_Demon C June 23, 2020, 3:02 p.m. OK GNU C++11 TESTS 25 46 5734400 1400
84856777 Even_Bao C June 24, 2020, 5:50 a.m. OK GNU C++11 TESTS 32 46 5734400 1400
84851315 YHHxBULIATANIA C June 24, 2020, 4:14 a.m. OK GNU C++11 TESTS 32 46 6553600 1400
84793948 OBJECT.705X C June 23, 2020, 3:06 p.m. OK GNU C++11 TESTS 25 61 5529600 1400
84795990 lzzAKIOI C June 23, 2020, 3:10 p.m. OK GNU C++11 TESTS 25 61 7168000 1400
84795617 absinthe C June 23, 2020, 3:10 p.m. OK GNU C++11 TESTS 25 62 5427200 1400
84785290 jhknmj C June 23, 2020, 2:49 p.m. OK GNU C++11 TESTS 25 62 6553600 1400
84806277 yhdjy C June 23, 2020, 3:36 p.m. OK GNU C++14 TESTS 25 93 5324800 1400
84792647 daydreamer233 C June 23, 2020, 3:03 p.m. OK GNU C++14 TESTS 25 93 6144000 1400
84804080 HHU-DengLun C June 23, 2020, 3:30 p.m. OK GNU C++14 TESTS 25 93 8192000 1400
84798929 ZERO.. C June 23, 2020, 3:17 p.m. OK GNU C++14 TESTS 25 109 5324800 1400
84793137 bharath. C June 23, 2020, 3:04 p.m. OK GNU C++14 TESTS 25 109 5324800 1400
84786897 luciocf C June 23, 2020, 2:52 p.m. OK GNU C++14 TESTS 25 109 5324800 1400
84845924 kkqq C June 24, 2020, 1:55 a.m. OK GNU C++14 TESTS 32 109 5324800 1400
84823682 daRoot C June 23, 2020, 5:23 p.m. OK GNU C++14 TESTS 25 109 5324800 1400
84792281 bhanurocks C June 23, 2020, 3:03 p.m. OK GNU C++14 TESTS 25 109 5529600 1400
84828232 islingr C June 23, 2020, 6:17 p.m. OK GNU C++14 TESTS 25 109 5836800 1400
84812372 Dull C June 23, 2020, 3:53 p.m. OK GNU C++17 TESTS 25 109 5324800 1400
84818362 Ahmed.Nasser C June 23, 2020, 4:39 p.m. OK GNU C++17 TESTS 25 109 5324800 1400
84788839 chen_zexing C June 23, 2020, 2:56 p.m. OK GNU C++17 TESTS 25 109 5324800 1400
84828319 Zeldacrafter C June 23, 2020, 6:19 p.m. OK GNU C++17 TESTS 25 109 5324800 1400
84804855 john_709 C June 23, 2020, 3:32 p.m. OK GNU C++17 TESTS 25 109 5324800 1400
84783179 fatnot C June 23, 2020, 2:45 p.m. OK GNU C++17 TESTS 25 109 5529600 1400
84813846 Saraw C June 23, 2020, 3:57 p.m. OK GNU C++17 TESTS 25 109 5632000 1400
84831470 nashmean C June 23, 2020, 7:03 p.m. OK GNU C++17 TESTS 25 109 6144000 1400
84779466 loK10 C June 23, 2020, 2:39 p.m. OK GNU C++17 TESTS 25 109 6451200 1400
84825933 ishank162 C June 23, 2020, 5:48 p.m. OK GNU C++17 TESTS 25 109 6451200 1400
84851090 yamcha C June 24, 2020, 4:09 a.m. OK GNU C++17 (64) TESTS 32 77 7475200 1400
84788678 I.Gleb C June 23, 2020, 2:55 p.m. OK GNU C++17 (64) TESTS 25 78 5836800 1400
84778089 ScarletS C June 23, 2020, 2:37 p.m. OK GNU C++17 (64) TESTS 25 78 5939200 1400
84852308 ghssh C June 24, 2020, 4:35 a.m. OK GNU C++17 (64) TESTS 32 78 5939200 1400
84855223 AMO5 C June 24, 2020, 5:26 a.m. OK GNU C++17 (64) TESTS 32 78 5939200 1400
84844193 AQZZ C June 24, 2020, 12:46 a.m. OK GNU C++17 (64) TESTS 26 78 6144000 1400
84789728 RunGood C June 23, 2020, 2:58 p.m. OK GNU C++17 (64) TESTS 25 78 6758400 1400
84814055 edenooo C June 23, 2020, 3:58 p.m. OK GNU C++17 (64) TESTS 25 78 6963200 1400
84819621 Jaadugar C June 23, 2020, 4:46 p.m. OK GNU C++17 (64) TESTS 25 78 7475200 1400
84850996 ShridharGoel C June 24, 2020, 4:07 a.m. OK GNU C++17 (64) TESTS 32 78 7475200 1400
84810166 snow_bear_328 C June 23, 2020, 3:47 p.m. OK Go TESTS 25 171 29696000 1400
84785798 maguroguma C June 23, 2020, 2:50 p.m. OK Go TESTS 25 202 20787200 1400
84801731 yaegashi C June 23, 2020, 3:24 p.m. OK Go TESTS 25 265 15872000 1400
84841159 Black_Fregat C June 23, 2020, 10:40 p.m. OK Haskell TESTS 25 1138 55705600 1400
84802292 pk_sinha53 C June 23, 2020, 3:26 p.m. OK Java 11 TESTS 25 202 24064000 1400
84821157 akman10 C June 23, 2020, 4:57 p.m. OK Java 11 TESTS 25 218 23859200 1400
84818852 saikaushik333 C June 23, 2020, 4:41 p.m. OK Java 11 TESTS 25 218 23961600 1400
84791679 atishay127 C June 23, 2020, 3:01 p.m. OK Java 11 TESTS 25 218 24064000 1400
84796383 jughead27 C June 23, 2020, 3:11 p.m. OK Java 11 TESTS 25 233 23961600 1400
84806096 wistful23 C June 23, 2020, 3:35 p.m. OK Java 11 TESTS 25 234 23961600 1400
84780707 nsmikhailov C June 23, 2020, 2:41 p.m. OK Java 11 TESTS 25 248 23859200 1400
84792293 sf14t C June 23, 2020, 3:03 p.m. OK Java 11 TESTS 25 248 24064000 1400
84834412 yb1717 C June 23, 2020, 7:50 p.m. OK Java 11 TESTS 25 249 23961600 1400
84782714 avijit_agarwal C June 23, 2020, 2:45 p.m. OK Java 11 TESTS 25 264 23859200 1400
84831383 Pranay2516 C June 23, 2020, 7:02 p.m. OK Java 8 TESTS 25 140 20684800 1400
84814054 atharvat77 C June 23, 2020, 3:58 p.m. OK Java 8 TESTS 25 140 20684800 1400
84794458 Sadakant C June 23, 2020, 3:07 p.m. OK Java 8 TESTS 25 140 20889600 1400
84779376 shashwat07 C June 23, 2020, 2:39 p.m. OK Java 8 TESTS 25 155 20582400 1400
84786195 KharYusuf C June 23, 2020, 2:51 p.m. OK Java 8 TESTS 25 155 20787200 1400
84799233 narushima C June 23, 2020, 3:18 p.m. OK Java 8 TESTS 25 155 20889600 1400
84789362 RockStar_14 C June 23, 2020, 2:57 p.m. OK Java 8 TESTS 25 155 20889600 1400
84806273 yash49 C June 23, 2020, 3:36 p.m. OK Java 8 TESTS 25 155 21196800 1400
84827149 Vaibhav_patel19 C June 23, 2020, 6:04 p.m. OK Java 8 TESTS 25 155 61337600 1400
84810453 Vaibhav_patel19 C June 23, 2020, 3:47 p.m. OK Java 8 TESTS 25 170 61337600 1400
84825977 Loremon C June 23, 2020, 5:49 p.m. OK JavaScript TESTS 25 295 40038400 1400
84857526 Spheniscine C June 24, 2020, 6:01 a.m. OK Kotlin TESTS 32 218 22835200 1400
84778281 yakamoto C June 23, 2020, 2:37 p.m. OK Kotlin TESTS 25 296 36556800 1400
84785308 rocketm C June 23, 2020, 2:49 p.m. OK Kotlin TESTS 25 404 54579200 1400
84779437 golions C June 23, 2020, 2:39 p.m. OK Kotlin TESTS 25 436 45363200 1400
84805706 xxxcul C June 23, 2020, 3:34 p.m. OK Kotlin TESTS 25 576 46387200 1400
84791673 abdukodir C June 23, 2020, 3:01 p.m. OK Kotlin TESTS 25 577 60928000 1400
84794613 wuchaojie925 C June 23, 2020, 3:08 p.m. OK Kotlin TESTS 25 607 46489600 1400
84811063 Siddhant_Khare C June 23, 2020, 3:49 p.m. OK Kotlin TESTS 25 638 46489600 1400
84843434 a11eca C June 24, 2020, 12:17 a.m. OK Kotlin TESTS 25 654 27238400 1400
84784819 sergmel C June 23, 2020, 2:48 p.m. OK Kotlin TESTS 25 655 47104000 1400
84782153 maddenvvs C June 23, 2020, 2:44 p.m. OK Mono C# TESTS 25 202 49254400 1400
84780058 eSeF_ C June 23, 2020, 2:40 p.m. OK Mono C# TESTS 25 218 112537600 1400
84780911 _Trung_Nguyen C June 23, 2020, 2:41 p.m. OK Mono C# TESTS 25 233 48230400 1400
84822531 avtoruxadze C June 23, 2020, 5:11 p.m. OK Mono C# TESTS 25 249 48742400 1400
84783639 mban259 C June 23, 2020, 2:46 p.m. OK Mono C# TESTS 25 249 49152000 1400
84786307 kuuso C June 23, 2020, 2:51 p.m. OK Mono C# TESTS 25 264 49152000 1400
84783180 Kolyanich C June 23, 2020, 2:45 p.m. OK Mono C# TESTS 25 280 11878400 1400
84794956 DaniilPanasenko C June 23, 2020, 3:08 p.m. OK Mono C# TESTS 25 280 45875200 1400
84810220 Arnyev C June 23, 2020, 3:47 p.m. OK Mono C# TESTS 25 280 53964800 1400
84813495 hedgedog C June 23, 2020, 3:56 p.m. OK Mono C# TESTS 25 296 44236800 1400
84791206 Goldexperienrce C June 23, 2020, 3:01 p.m. OK MS C++ TESTS 25 156 7372800 1400
84814270 YTICpoch C June 23, 2020, 3:58 p.m. OK MS C++ TESTS 25 265 5734400 1400
84803912 JuicyCloud12609 C June 23, 2020, 3:30 p.m. OK MS C++ TESTS 25 296 7270400 1400
84826256 tnhien C June 23, 2020, 5:53 p.m. OK MS C++ TESTS 25 311 7372800 1400
84799345 tarattata1 C June 23, 2020, 3:18 p.m. OK MS C++ 2017 TESTS 25 140 5324800 1400
84803255 otarra C June 23, 2020, 3:28 p.m. OK MS C++ 2017 TESTS 25 140 5529600 1400
84778641 P___ C June 23, 2020, 2:38 p.m. OK MS C++ 2017 TESTS 25 140 6041600 1400
84847624 NCG4039. C June 24, 2020, 2:43 a.m. OK MS C++ 2017 TESTS 32 140 7168000 1400
84812577 TMHazem C June 23, 2020, 3:54 p.m. OK MS C++ 2017 TESTS 25 140 8806400 1400
84820134 ningBr C June 23, 2020, 4:49 p.m. OK MS C++ 2017 TESTS 25 155 5324800 1400
84792758 mutsuki C June 23, 2020, 3:04 p.m. OK MS C++ 2017 TESTS 25 155 7168000 1400
84782316 Wonsei C June 23, 2020, 2:44 p.m. OK MS C++ 2017 TESTS 25 296 5324800 1400
84800434 poormate C June 23, 2020, 3:21 p.m. OK MS C++ 2017 TESTS 25 311 5324800 1400
84843794 pjh6792 C June 24, 2020, 12:30 a.m. OK MS C++ 2017 TESTS 25 311 5324800 1400
84803582 klond90 C June 23, 2020, 3:29 p.m. OK Node.js TESTS 25 405 43315200 1400
84802093 Loremon C June 23, 2020, 3:25 p.m. OK Node.js TESTS 25 623 43520000 1400
84783348 raj1307 C June 23, 2020, 2:46 p.m. OK PyPy 2 TESTS 25 296 45158400 1400
84780519 realnimish C June 23, 2020, 2:41 p.m. OK PyPy 2 TESTS 25 296 45465600 1400
84792907 sksshivam007 C June 23, 2020, 3:04 p.m. OK PyPy 2 TESTS 25 311 45670400 1400
84795356 ycui11 C June 23, 2020, 3:09 p.m. OK PyPy 2 TESTS 25 312 44134400 1400
84783250 Mukundan314 C June 23, 2020, 2:45 p.m. OK PyPy 2 TESTS 25 327 44441600 1400
84835463 shadoX C June 23, 2020, 8:10 p.m. OK PyPy 2 TESTS 25 327 44851200 1400
84806636 chaudhary_19 C June 23, 2020, 3:37 p.m. OK PyPy 2 TESTS 25 327 46796800 1400
84851290 Sameer-Mann C June 24, 2020, 4:14 a.m. OK PyPy 2 TESTS 32 514 40755200 1400
84781741 rajasbansal1998 C June 23, 2020, 2:43 p.m. OK PyPy 2 TESTS 25 514 41062400 1400
84784154 shehebe C June 23, 2020, 2:47 p.m. OK PyPy 2 TESTS 25 529 39526400 1400
84844871 ss7890 C June 24, 2020, 1:13 a.m. OK PyPy 3 TESTS 26 280 40857600 1400
84849860 Shantanu_Rathod C June 24, 2020, 3:40 a.m. OK PyPy 3 TESTS 32 280 41369600 1400
84837348 emma C June 23, 2020, 8:47 p.m. OK PyPy 3 TESTS 25 295 46080000 1400
84798282 servermonk C June 23, 2020, 3:16 p.m. OK PyPy 3 TESTS 25 296 40857600 1400
84795246 gintoki_s C June 23, 2020, 3:09 p.m. OK PyPy 3 TESTS 25 296 40857600 1400
84778411 forforfor C June 23, 2020, 2:37 p.m. OK PyPy 3 TESTS 25 296 45875200 1400
84778146 wattaihei C June 23, 2020, 2:37 p.m. OK PyPy 3 TESTS 25 311 41267200 1400
84787049 aberent C June 23, 2020, 2:52 p.m. OK PyPy 3 TESTS 25 311 41676800 1400
84790716 Rajdeep2k C June 23, 2020, 3 p.m. OK PyPy 3 TESTS 25 311 45568000 1400
84850721 2019ucp1350 C June 24, 2020, 4:01 a.m. OK PyPy 3 TESTS 32 311 45772800 1400
84780738 ap1008 C June 23, 2020, 2:41 p.m. OK Python 2 TESTS 25 498 18329600 1400
84791641 Hiroshi.K C June 23, 2020, 3:01 p.m. OK Python 3 TESTS 25 343 24064000 1400
84809969 himanshu18038 C June 23, 2020, 3:46 p.m. OK Python 3 TESTS 25 389 24576000 1400
84794376 sylvain.berube C June 23, 2020, 3:07 p.m. OK Python 3 TESTS 25 405 24064000 1400
84792311 BlackBook9406 C June 23, 2020, 3:03 p.m. OK Python 3 TESTS 25 405 24883200 1400
84847523 parasite13 C June 24, 2020, 2:40 a.m. OK Python 3 TESTS 32 405 25190400 1400
84795361 beta_raj C June 23, 2020, 3:09 p.m. OK Python 3 TESTS 25 405 25497600 1400
84800191 oldos C June 23, 2020, 3:20 p.m. OK Python 3 TESTS 25 420 24064000 1400
84787846 neelabh17 C June 23, 2020, 2:54 p.m. OK Python 3 TESTS 25 420 24268800 1400
84831163 RandomNumber C June 23, 2020, 6:58 p.m. OK Python 3 TESTS 25 420 24576000 1400
84797457 sangonana C June 23, 2020, 3:14 p.m. OK Python 3 TESTS 25 420 24576000 1400
84779753 cotton100pc C June 23, 2020, 2:40 p.m. OK Rust TESTS 25 108 11571200 1400
84854478 rustafarian C June 24, 2020, 5:14 a.m. OK Rust TESTS 32 124 17305600 1400
84791287 MyK_00L C June 23, 2020, 3:01 p.m. OK Rust TESTS 25 124 17510400 1400
84796965 ktn_yuta C June 23, 2020, 3:13 p.m. OK Rust TESTS 25 186 10854400 1400
84784624 GeoffreyY C June 23, 2020, 2:48 p.m. OK Rust TESTS 25 187 9318400 1400
84803820 t_uchida C June 23, 2020, 3:29 p.m. OK Rust TESTS 25 202 10854400 1400
84779794 robostac C June 23, 2020, 2:40 p.m. OK Rust TESTS 25 202 12390400 1400
84786324 fatemender C June 23, 2020, 2:51 p.m. OK Rust TESTS 25 233 18227200 1400
84796182 pandrei C June 23, 2020, 3:11 p.m. OK Rust TESTS 25 234 21094400 1400
84806641 LLIAMA3OB C June 23, 2020, 3:37 p.m. OK Scala TESTS 25 717 55500800 1400

remove filters

Back to search problems