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 |
---|---|---|---|---|---|---|
1676 | Codeforces Round 790 (Div. 4) | FINISHED | False | 7200 | 85072463 | May 10, 2022, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 50795 ) | B | Equal Candies | PROGRAMMING | greedy math sortings |
B"There are n boxes with different quantities of candies in each of them. The i -th box has a_i candies inside. You also have n friends that you want to give the candies to, so you decided to give each friend a box of candies. But, you don't want any friends to get upset so you decided to eat some (possibly none) candies from each box so that all boxes have the same quantity of candies in them. Note that you may eat a different number of candies from different boxes and you cannot add candies to any of the boxes. What's the minimum total number of candies you have to eat to satisfy the requirements? The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The first line of each test case contains an integer n ( 1 <= q n <= q 50 ) -- the number of boxes you have. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q 10^7 ) -- the quantity of candies in each box. For each test case, print a single integer denoting the minimum number of candies you have to eat to satisfy the requirements. For the first test case, you can eat 1 candy from the second box, 2 candies from the third box, 3 candies from the fourth box and 4 candies from the fifth box. Now the boxes have [1, 1, 1, 1, 1] candies in them and you ate 0 + 1 + 2 + 3 + 4 = 10 candies in total so the answer is 10 . For the second test case, the best answer is obtained by making all boxes contain 5 candies in them, thus eating 995 + 995 + 0 + 995 + 995 + 995 = 4975 candies in total. "... |
Codeforces Round #790 (Div. 4) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
156816935 | hurshedabdullaev | B | May 11, 2022, 10:07 a.m. | OK | C# 10 | TESTS | 6 | 62 | 3174400 | ||
156820206 | vjudge3 | B | May 11, 2022, 10:45 a.m. | OK | Clang++17 Diagnostics | TESTS | 6 | 248 | 0 | ||
156846297 | smart_Pig | B | May 11, 2022, 3:26 p.m. | OK | Clang++17 Diagnostics | TESTS | 6 | 249 | 0 | ||
156823460 | bkifhr9 | B | May 11, 2022, 11:22 a.m. | OK | Clang++17 Diagnostics | TESTS | 6 | 264 | 0 | ||
156829380 | bkifhr10 | B | May 11, 2022, 12:22 p.m. | OK | Clang++17 Diagnostics | TESTS | 6 | 264 | 409600 | ||
156845159 | PapayaNguyen | B | May 11, 2022, 3:12 p.m. | OK | FPC | TESTS | 6 | 15 | 0 | ||
156844617 | thinhcute | B | May 11, 2022, 3:05 p.m. | OK | FPC | TESTS | 6 | 15 | 0 | ||
156788112 | Terol12 | B | May 11, 2022, 6:46 a.m. | OK | FPC | TESTS | 6 | 31 | 0 | ||
156827433 | tangyuanya | B | May 11, 2022, 12:02 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156833303 | Kohlrabi | B | May 11, 2022, 1:01 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156833584 | rakib151p | B | May 11, 2022, 1:04 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156844262 | anant_EA_ET | B | May 11, 2022, 3:01 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156846919 | fatherof0416 | B | May 11, 2022, 3:34 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156851597 | Rizon112233 | B | May 11, 2022, 4:31 p.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156879331 | Hema_203 | B | May 12, 2022, 3 a.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156884620 | Deer-hu | B | May 12, 2022, 4:58 a.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156823881 | sravanigajula007 | B | May 11, 2022, 11:26 a.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156824674 | A_Z_NATH | B | May 11, 2022, 11:35 a.m. | OK | GNU C11 | TESTS | 6 | 15 | 0 | ||
156829915 | slzxpanhongxuan | B | May 11, 2022, 12:28 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156875877 | simon_Sun | B | May 12, 2022, 1:13 a.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156842681 | p0keer | B | May 11, 2022, 2:40 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156836424 | simon_Sun | B | May 11, 2022, 1:32 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156834363 | Ricardo.J.Chen | B | May 11, 2022, 1:12 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156832703 | hello_venns | B | May 11, 2022, 12:55 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 0 | ||
156794837 | Sagar_1999Kr | B | May 11, 2022, 8:10 a.m. | OK | GNU C++14 | TESTS | 6 | 0 | 102400 | ||
156856979 | Hizzl | B | May 11, 2022, 5:44 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 102400 | ||
156857217 | RifatXia | B | May 11, 2022, 5:47 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 102400 | ||
156827523 | albeXL | B | May 11, 2022, 12:03 p.m. | OK | GNU C++14 | TESTS | 6 | 0 | 102400 | ||
156860598 | jahid_hridoy | B | May 11, 2022, 6:31 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156875328 | bodelegaurav | B | May 12, 2022, 12:52 a.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156833000 | Dady_love | B | May 11, 2022, 12:58 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156834797 | A-star | B | May 11, 2022, 1:16 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156849273 | peti1234 | B | May 11, 2022, 4:02 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156852415 | leencer2k | B | May 11, 2022, 4:41 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156855000 | Coder_Shan_2001 | B | May 11, 2022, 5:18 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156829259 | anand_iitb | B | May 11, 2022, 12:21 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156829047 | anmol73 | B | May 11, 2022, 12:19 p.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156798825 | KAUSTUBH152003 | B | May 11, 2022, 8:57 a.m. | OK | GNU C++17 | TESTS | 6 | 0 | 0 | ||
156850983 | contrust | B | May 11, 2022, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156879454 | dlehgns011 | B | May 12, 2022, 3:03 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156878780 | tonyli00000 | B | May 12, 2022, 2:44 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156860272 | aliasgar_45 | B | May 11, 2022, 6:27 p.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156831597 | _Yeager_ | B | May 11, 2022, 12:44 p.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156825995 | hellojim | B | May 11, 2022, 11:48 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156787375 | isheoran | B | May 11, 2022, 6:38 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156786970 | julianferres | B | May 11, 2022, 6:33 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 0 | 0 | ||
156878450 | Ziad_Reda | B | May 12, 2022, 2:34 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
156883375 | DaLeR_21 | B | May 12, 2022, 4:33 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
156852923 | Proofy | B | May 11, 2022, 4:48 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156855196 | Alhomse | B | May 11, 2022, 5:21 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156860509 | unfeel | B | May 11, 2022, 6:30 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156861927 | I_Remember_Olya_ashmelev | B | May 11, 2022, 6:50 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156876224 | Fear_less | B | May 12, 2022, 1:25 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156884866 | R.Ayush777 | B | May 12, 2022, 5:04 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156886869 | AWei | B | May 12, 2022, 5:41 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156886932 | kartikey01 | B | May 12, 2022, 5:41 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156848524 | jjjfr | B | May 11, 2022, 3:53 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156846311 | Akash_123 | B | May 11, 2022, 3:27 p.m. | OK | GNU C++20 (64) | TESTS | 6 | 0 | 0 | ||
156864215 | brian | B | May 11, 2022, 7:27 p.m. | OK | Go | TESTS | 6 | 31 | 716800 | ||
156887723 | jujimeizuo | B | May 12, 2022, 5:55 a.m. | OK | Go | TESTS | 6 | 46 | 614400 | ||
156824077 | SaberXpro | B | May 11, 2022, 11:29 a.m. | OK | Java 11 | TESTS | 6 | 171 | 0 | ||
156822182 | lock_infinity | B | May 11, 2022, 11:09 a.m. | OK | Java 11 | TESTS | 6 | 171 | 0 | ||
156872860 | MunirKP | B | May 11, 2022, 11:07 p.m. | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
156861504 | gauravvv2204 | B | May 11, 2022, 6:43 p.m. | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
156830155 | anmol.mact | B | May 11, 2022, 12:30 p.m. | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
156827166 | Bahaalization | B | May 11, 2022, noon | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
156791778 | amitmandal | B | May 11, 2022, 7:32 a.m. | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
156828731 | velocity_9 | B | May 11, 2022, 12:16 p.m. | OK | Java 11 | TESTS | 6 | 202 | 0 | ||
156787182 | eshan18.09 | B | May 11, 2022, 6:36 a.m. | OK | Java 11 | TESTS | 6 | 217 | 0 | ||
156885417 | shimasima2 | B | May 12, 2022, 5:14 a.m. | OK | Java 11 | TESTS | 6 | 233 | 0 | ||
156873600 | kzhang2012 | B | May 11, 2022, 11:40 p.m. | OK | Java 8 | TESTS | 6 | 93 | 0 | ||
156832216 | sharpen | B | May 11, 2022, 12:50 p.m. | OK | Java 8 | TESTS | 6 | 93 | 0 | ||
156863329 | MaximSysoev | B | May 11, 2022, 7:12 p.m. | OK | Java 8 | TESTS | 6 | 108 | 0 | ||
156865250 | FirePegasus | B | May 11, 2022, 7:45 p.m. | OK | Java 8 | TESTS | 6 | 108 | 0 | ||
156824806 | akshaykumar200042 | B | May 11, 2022, 11:36 a.m. | OK | Java 8 | TESTS | 6 | 108 | 0 | ||
156821966 | hassanU | B | May 11, 2022, 11:06 a.m. | OK | Java 8 | TESTS | 6 | 108 | 0 | ||
156879534 | abhi_shri | B | May 12, 2022, 3:05 a.m. | OK | Java 8 | TESTS | 6 | 109 | 0 | ||
156815604 | Mahip_19 | B | May 11, 2022, 9:51 a.m. | OK | Java 8 | TESTS | 6 | 109 | 0 | ||
156884993 | hassanfahd75 | B | May 12, 2022, 5:06 a.m. | OK | Java 8 | TESTS | 6 | 124 | 0 | ||
156886554 | Prabhat17 | B | May 12, 2022, 5:35 a.m. | OK | Java 8 | TESTS | 6 | 155 | 0 | ||
156799137 | PeredurOmega | B | May 11, 2022, 9 a.m. | OK | Kotlin 1.4 | TESTS | 6 | 140 | 204800 | ||
156817537 | malathi.dharma60 | B | May 11, 2022, 10:15 a.m. | OK | Kotlin 1.4 | TESTS | 6 | 140 | 204800 | ||
156822702 | Superlau | B | May 11, 2022, 11:15 a.m. | OK | MS C++ 2017 | TESTS | 6 | 15 | 819200 | ||
156829763 | CJXX | B | May 11, 2022, 12:26 p.m. | OK | MS C++ 2017 | TESTS | 6 | 31 | 0 | ||
156790584 | atulya282 | B | May 11, 2022, 7:17 a.m. | OK | MS C++ 2017 | TESTS | 6 | 31 | 204800 | ||
156850317 | Still_Theory | B | May 11, 2022, 4:15 p.m. | OK | MS C++ 2017 | TESTS | 6 | 46 | 0 | ||
156847899 | 1_shivam | B | May 11, 2022, 3:46 p.m. | OK | MS C++ 2017 | TESTS | 6 | 46 | 0 | ||
156829896 | lyg3715371537 | B | May 11, 2022, 12:27 p.m. | OK | MS C++ 2017 | TESTS | 6 | 46 | 0 | ||
156801012 | Jhingyo | B | May 11, 2022, 9:23 a.m. | OK | MS C++ 2017 | TESTS | 6 | 46 | 204800 | ||
156799110 | XYShaoKang | B | May 11, 2022, 9 a.m. | OK | Node.js | TESTS | 6 | 62 | 5427200 | ||
156787934 | Artik20 | B | May 11, 2022, 6:44 a.m. | OK | PascalABC.NET | TESTS | 6 | 265 | 102400 | ||
156834037 | 51-Pegasai-b | B | May 11, 2022, 1:09 p.m. | OK | PHP | TESTS | 6 | 904 | 0 | ||
156852545 | ambs_ | B | May 11, 2022, 4:43 p.m. | OK | PyPy 3 | TESTS | 6 | 139 | 3481600 | ||
156800543 | Aya_Elwakil | B | May 11, 2022, 9:18 a.m. | OK | PyPy 3 | TESTS | 6 | 155 | 5939200 | ||
156798910 | lxylluvio | B | May 11, 2022, 8:58 a.m. | OK | PyPy 3 | TESTS | 6 | 155 | 6246400 | ||
156849558 | ttorpy | B | May 11, 2022, 4:06 p.m. | OK | PyPy 3 | TESTS | 6 | 171 | 4915200 | ||
156833075 | hk10537 | B | May 11, 2022, 12:59 p.m. | OK | PyPy 3 | TESTS | 6 | 171 | 5632000 | ||
156851610 | manohar2509 | B | May 11, 2022, 4:31 p.m. | OK | PyPy 3 | TESTS | 6 | 171 | 7065600 | ||
156866506 | satanic_turtle | B | May 11, 2022, 8:08 p.m. | OK | PyPy 3 | TESTS | 6 | 186 | 5939200 | ||
156858232 | udayps055 | B | May 11, 2022, 5:59 p.m. | OK | PyPy 3 | TESTS | 6 | 186 | 6246400 | ||
156881713 | erudition_0705 | B | May 12, 2022, 3:57 a.m. | OK | PyPy 3 | TESTS | 6 | 202 | 5529600 | ||
156848832 | bronze_coder | B | May 11, 2022, 3:57 p.m. | OK | PyPy 3 | TESTS | 6 | 202 | 6144000 | ||
156790991 | sinsung6722 | B | May 11, 2022, 7:22 a.m. | OK | PyPy 3-64 | TESTS | 6 | 77 | 4300800 | ||
156854873 | notTehlka | B | May 11, 2022, 5:16 p.m. | OK | PyPy 3-64 | TESTS | 6 | 92 | 3891200 | ||
156869528 | assa_codeforses | B | May 11, 2022, 9:13 p.m. | OK | PyPy 3-64 | TESTS | 6 | 93 | 4505600 | ||
156859529 | MistaAsh | B | May 11, 2022, 6:17 p.m. | OK | PyPy 3-64 | TESTS | 6 | 93 | 5120000 | ||
156817619 | chen.mercer | B | May 11, 2022, 10:16 a.m. | OK | PyPy 3-64 | TESTS | 6 | 93 | 5120000 | ||
156818032 | jainmilind | B | May 11, 2022, 10:20 a.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 4812800 | ||
156800654 | asdsasd | B | May 11, 2022, 9:19 a.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 5120000 | ||
156870378 | criforces | B | May 11, 2022, 9:35 p.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 4812800 | ||
156878299 | jloai009 | B | May 12, 2022, 2:31 a.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 5017600 | ||
156821825 | Invinc3 | B | May 11, 2022, 11:05 a.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 6451200 | ||
156885058 | psycho_pirate | B | May 12, 2022, 5:07 a.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156876054 | xiaoranran | B | May 12, 2022, 1:19 a.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156872674 | deepaklaksman | B | May 11, 2022, 10:58 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156856296 | vl342 | B | May 11, 2022, 5:36 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156849334 | chris_pix | B | May 11, 2022, 4:03 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156845913 | suyashmadhesia | B | May 11, 2022, 3:22 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156840845 | keerthanr | B | May 11, 2022, 2:20 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156833072 | COUB | B | May 11, 2022, 12:59 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156827617 | _aDVEINo_ | B | May 11, 2022, 12:04 p.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156826598 | prabhat135 | B | May 11, 2022, 11:54 a.m. | OK | Python 3 | TESTS | 6 | 46 | 0 | ||
156828521 | purojok | B | May 11, 2022, 12:14 p.m. | OK | Rust 2021 | TESTS | 6 | 15 | 0 | ||
156830781 | lixx24 | B | May 11, 2022, 12:36 p.m. | OK | Scala | TESTS | 6 | 482 | 0 |
Back to search problems