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 |
---|---|---|---|---|---|---|
1537 | Codeforces Round 726 (Div. 2) | FINISHED | False | 7200 | 113239463 | June 18, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 37992 ) | A | Arithmetic Array | PROGRAMMING | greedy math |
B"An array b of length k is called good if its arithmetic mean is equal to 1 . More formally, if frac{b_1 + cdots + b_k}{k}=1. Note that the value frac{b_1+ cdots+b_k}{k} is not rounded up or down. For example, the array [1,1,1,2] has an arithmetic mean of 1.25 , which is not equal to 1 . You are given an integer array a of length n . In an operation, you can append a non-negative integer to the end of the array. What's the minimum number of operations required to make the array good? We have a proof that it is always possible with finitely many operations. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Then t test cases follow. The first line of each test case contains a single integer n ( 1 <= q n <= q 50 ) -- the length of the initial array a . The second line of each test case contains n integers a_1, ldots,a_n ( -10^4 <= q a_i <= q 10^4 ), the elements of the array. For each test case, output a single integer -- the minimum number of non-negative integers you have to append to the array so that the arithmetic mean of the array will be exactly 1 . In the first test case, we don't need to add any element because the arithmetic mean of the array is already 1 , so the answer is 0 . In the second test case, the arithmetic mean is not 1 initially so we need to add at least one more number. If we add 0 then the arithmetic mean of the whole array becomes 1 , so the answer is 1 . In the third test case, the minimum number of elements that need to be added is 16 since only non-negative integers can be added. In the fourth test case, we can add a single integer 4 . The arithmetic mean becomes frac{-2+4}{2} which is equal to 1 . "... |
Codeforces Round #726 (Div.2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
119941679 | royo_sea | A | June 19, 2021, 3:28 a.m. | OK | FPC | TESTS | 31 | 46 | 0 | ||
119941331 | anuragr135 | A | June 19, 2021, 3:22 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119943778 | roopashree123 | A | June 19, 2021, 4 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119944994 | Erd0s | A | June 19, 2021, 4:18 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119951403 | Aony | A | June 19, 2021, 5:32 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119953629 | bnurgeldiyev514 | A | June 19, 2021, 5:53 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119916339 | Adi1443 | A | June 18, 2021, 6:26 p.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119927621 | Lunessel | A | June 18, 2021, 8:36 p.m. | OK | GNU C11 | TESTS | 31 | 31 | 0 | ||
119945389 | patil98varad | A | June 19, 2021, 4:24 a.m. | OK | GNU C11 | TESTS | 31 | 31 | 409600 | ||
119946286 | Sravanth_IIITS | A | June 19, 2021, 4:34 a.m. | OK | GNU C11 | TESTS | 31 | 46 | 0 | ||
119950049 | tarushi_2002 | A | June 19, 2021, 5:17 a.m. | OK | GNU C11 | TESTS | 31 | 46 | 0 | ||
119943323 | Chenfree | A | June 19, 2021, 3:53 a.m. | OK | GNU C++11 | TESTS | 31 | 15 | 0 | ||
119940472 | Twilight_Dark | A | June 19, 2021, 3:08 a.m. | OK | GNU C++11 | TESTS | 31 | 15 | 819200 | ||
119954096 | BILL666 | A | June 19, 2021, 5:58 a.m. | OK | GNU C++11 | TESTS | 31 | 30 | 0 | ||
119933643 | Ninelife_Cat | A | June 19, 2021, 12:22 a.m. | OK | GNU C++11 | TESTS | 31 | 30 | 0 | ||
119948877 | Bananana. | A | June 19, 2021, 5:05 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119951492 | khushank09 | A | June 19, 2021, 5:33 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119951191 | SSV | A | June 19, 2021, 5:30 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119945672 | liangruichen | A | June 19, 2021, 4:27 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119938925 | distant-sky | A | June 19, 2021, 2:42 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119938882 | Sham_Devour | A | June 19, 2021, 2:41 a.m. | OK | GNU C++11 | TESTS | 31 | 31 | 0 | ||
119923797 | parasnagpal05 | A | June 18, 2021, 7:34 p.m. | OK | GNU C++14 | TESTS | 31 | 30 | 0 | ||
119954073 | rajathatr19 | A | June 19, 2021, 5:58 a.m. | OK | GNU C++14 | TESTS | 31 | 30 | 0 | ||
119948233 | cupvis | A | June 19, 2021, 4:58 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119948972 | Shubh1099 | A | June 19, 2021, 5:06 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119950582 | errorbynight | A | June 19, 2021, 5:23 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119951034 | spambhar | A | June 19, 2021, 5:28 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119951053 | namit_sh | A | June 19, 2021, 5:28 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119952438 | 201801133 | A | June 19, 2021, 5:42 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119947959 | Aniket_Y | A | June 19, 2021, 4:55 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119948176 | hardy_9795 | A | June 19, 2021, 4:58 a.m. | OK | GNU C++14 | TESTS | 31 | 31 | 0 | ||
119925764 | rk2002 | A | June 18, 2021, 8:04 p.m. | OK | GNU C++17 | TESTS | 31 | 30 | 0 | ||
119938583 | sir_suspicious | A | June 19, 2021, 2:36 a.m. | OK | GNU C++17 | TESTS | 31 | 30 | 0 | ||
119920087 | andrew.butylkin | A | June 18, 2021, 6:57 p.m. | OK | GNU C++17 | TESTS | 31 | 30 | 0 | ||
119946665 | hsekharsahoo | A | June 19, 2021, 4:39 a.m. | OK | GNU C++17 | TESTS | 31 | 30 | 102400 | ||
119934311 | Sekai02 | A | June 19, 2021, 12:50 a.m. | OK | GNU C++17 | TESTS | 31 | 30 | 102400 | ||
119944831 | dearthefire | A | June 19, 2021, 4:16 a.m. | OK | GNU C++17 | TESTS | 31 | 30 | 204800 | ||
119948529 | tejasmn | A | June 19, 2021, 5:01 a.m. | OK | GNU C++17 | TESTS | 31 | 30 | 204800 | ||
119926590 | reyna1607 | A | June 18, 2021, 8:18 p.m. | OK | GNU C++17 | TESTS | 31 | 30 | 204800 | ||
119954334 | ElaineHuang | A | June 19, 2021, 6 a.m. | OK | GNU C++17 | TESTS | 31 | 31 | 0 | ||
119954411 | venkatkiran | A | June 19, 2021, 6:01 a.m. | OK | GNU C++17 | TESTS | 31 | 31 | 0 | ||
119921166 | ShivY08 | A | June 18, 2021, 7:06 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119950584 | golden.duck | A | June 19, 2021, 5:23 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119945136 | Chingum | A | June 19, 2021, 4:20 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119944139 | RedDragon | A | June 19, 2021, 4:06 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119941360 | _berserker | A | June 19, 2021, 3:22 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119936280 | RandomNumber | A | June 19, 2021, 1:45 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119933455 | Snuc | A | June 19, 2021, 12:14 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119923819 | Beas | A | June 18, 2021, 7:35 p.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 0 | ||
119935776 | zzlzzlzzl | A | June 19, 2021, 1:33 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 30 | 1433600 | ||
119953565 | Bob15324 | A | June 19, 2021, 5:53 a.m. | OK | GNU C++17 (64) | TESTS | 31 | 31 | 0 | ||
119947286 | 0x3F | A | June 19, 2021, 4:47 a.m. | OK | Go | TESTS | 31 | 46 | 0 | ||
119953925 | SemonChan | A | June 19, 2021, 5:56 a.m. | OK | Go | TESTS | 31 | 46 | 102400 | ||
119947439 | 0x3F | A | June 19, 2021, 4:49 a.m. | OK | Go | TESTS | 31 | 46 | 102400 | ||
119930678 | vekarpov | A | June 18, 2021, 9:55 p.m. | OK | Go | TESTS | 31 | 841 | 102400 | ||
119939819 | nguyenkimphuongtrang | A | June 19, 2021, 2:57 a.m. | OK | Haskell | TESTS | 31 | 124 | 102400 | ||
119949558 | vsaijan4 | A | June 19, 2021, 5:12 a.m. | OK | Java 11 | TESTS | 31 | 187 | 0 | ||
119949433 | ypa | A | June 19, 2021, 5:11 a.m. | OK | Java 11 | TESTS | 31 | 187 | 0 | ||
119944663 | algothink | A | June 19, 2021, 4:13 a.m. | OK | Java 11 | TESTS | 31 | 187 | 0 | ||
119919702 | cribabby | A | June 18, 2021, 6:54 p.m. | OK | Java 11 | TESTS | 31 | 187 | 0 | ||
119945948 | Pradyumn.Agrawal | A | June 19, 2021, 4:30 a.m. | OK | Java 11 | TESTS | 31 | 202 | 0 | ||
119943012 | codeMinister | A | June 19, 2021, 3:48 a.m. | OK | Java 11 | TESTS | 31 | 202 | 0 | ||
119953560 | zenilharia26 | A | June 19, 2021, 5:53 a.m. | OK | Java 11 | TESTS | 31 | 202 | 0 | ||
119929539 | Plums | A | June 18, 2021, 9:20 p.m. | OK | Java 11 | TESTS | 31 | 202 | 0 | ||
119950476 | krishnam_rathi | A | June 19, 2021, 5:22 a.m. | OK | Java 11 | TESTS | 31 | 218 | 0 | ||
119944188 | sjit_18 | A | June 19, 2021, 4:06 a.m. | OK | Java 11 | TESTS | 31 | 218 | 0 | ||
119928305 | gagan_6730 | A | June 18, 2021, 8:50 p.m. | OK | Java 8 | TESTS | 31 | 109 | 0 | ||
119944198 | abhi_718 | A | June 19, 2021, 4:07 a.m. | OK | Java 8 | TESTS | 31 | 124 | 0 | ||
119948530 | krishnareddy.nancheri | A | June 19, 2021, 5:02 a.m. | OK | Java 8 | TESTS | 31 | 139 | 0 | ||
119923118 | kvedula2004 | A | June 18, 2021, 7:25 p.m. | OK | Java 8 | TESTS | 31 | 139 | 0 | ||
119921147 | tishrah_ | A | June 18, 2021, 7:06 p.m. | OK | Java 8 | TESTS | 31 | 139 | 0 | ||
119918942 | 0xRmQu | A | June 18, 2021, 6:45 p.m. | OK | Java 8 | TESTS | 31 | 140 | 0 | ||
119953611 | akshaygupta26 | A | June 19, 2021, 5:53 a.m. | OK | Java 8 | TESTS | 31 | 140 | 0 | ||
119928498 | Zicko-77 | A | June 18, 2021, 8:54 p.m. | OK | Java 8 | TESTS | 31 | 140 | 0 | ||
119918185 | Ashu_007 | A | June 18, 2021, 6:38 p.m. | OK | Java 8 | TESTS | 31 | 140 | 0 | ||
119935946 | anecpertcoder | A | June 19, 2021, 1:37 a.m. | OK | Java 8 | TESTS | 31 | 155 | 0 | ||
119951050 | TRR | A | June 19, 2021, 5:28 a.m. | OK | Mono C# | TESTS | 31 | 77 | 2969600 | ||
119918480 | youseftb | A | June 18, 2021, 6:40 p.m. | OK | MS C++ | TESTS | 31 | 62 | 0 | ||
119936059 | ProgroPhrogo | A | June 19, 2021, 1:40 a.m. | OK | MS C++ 2017 | TESTS | 31 | 46 | 0 | ||
119921571 | Vitazzz | A | June 18, 2021, 7:10 p.m. | OK | MS C++ 2017 | TESTS | 31 | 46 | 0 | ||
119918520 | youseftb | A | June 18, 2021, 6:41 p.m. | OK | MS C++ 2017 | TESTS | 31 | 46 | 0 | ||
119939328 | mnrmustafa | A | June 19, 2021, 2:49 a.m. | OK | MS C++ 2017 | TESTS | 31 | 46 | 0 | ||
119923522 | FoxtrotEcho | A | June 18, 2021, 7:31 p.m. | OK | MS C++ 2017 | TESTS | 31 | 61 | 0 | ||
119922364 | PRATHYUSH | A | June 18, 2021, 7:17 p.m. | OK | MS C++ 2017 | TESTS | 31 | 61 | 0 | ||
119931717 | ZTFeng | A | June 18, 2021, 10:33 p.m. | OK | MS C++ 2017 | TESTS | 31 | 61 | 0 | ||
119952577 | khan_saifkhan_ | A | June 19, 2021, 5:44 a.m. | OK | MS C++ 2017 | TESTS | 31 | 62 | 0 | ||
119928310 | gleb.zuev04 | A | June 18, 2021, 8:50 p.m. | OK | MS C++ 2017 | TESTS | 31 | 62 | 0 | ||
119932214 | samnext9 | A | June 18, 2021, 11 p.m. | OK | MS C++ 2017 | TESTS | 31 | 62 | 204800 | ||
119918308 | henrychenOutlook | A | June 18, 2021, 6:38 p.m. | OK | Node.js | TESTS | 31 | 124 | 4505600 | ||
119917640 | PAG | A | June 18, 2021, 6:34 p.m. | OK | PascalABC.NET | TESTS | 31 | 312 | 3379200 | ||
119919924 | InvalidSyntax | A | June 18, 2021, 6:56 p.m. | OK | PyPy 3 | TESTS | 31 | 139 | 2867200 | ||
119916938 | alterego_14 | A | June 18, 2021, 6:29 p.m. | OK | PyPy 3 | TESTS | 31 | 140 | 2355200 | ||
119932717 | jano31415 | A | June 18, 2021, 11:28 p.m. | OK | PyPy 3 | TESTS | 31 | 140 | 2457600 | ||
119943744 | jitendra_joshi3112000 | A | June 19, 2021, 4 a.m. | OK | PyPy 3 | TESTS | 31 | 140 | 2560000 | ||
119919774 | _aadiupadhyay_ | A | June 18, 2021, 6:55 p.m. | OK | PyPy 3 | TESTS | 31 | 140 | 2764800 | ||
119916289 | im__skp | A | June 18, 2021, 6:26 p.m. | OK | PyPy 3 | TESTS | 31 | 140 | 2867200 | ||
119949482 | polingram | A | June 19, 2021, 5:11 a.m. | OK | PyPy 3 | TESTS | 31 | 140 | 67788800 | ||
119943731 | ___Neo___ | A | June 19, 2021, 4 a.m. | OK | PyPy 3 | TESTS | 31 | 155 | 2867200 | ||
119918589 | abhisheka950 | A | June 18, 2021, 6:41 p.m. | OK | PyPy 3 | TESTS | 31 | 155 | 2969600 | ||
119927438 | sarthak_bharadwaj_ | A | June 18, 2021, 8:33 p.m. | OK | PyPy 3 | TESTS | 31 | 155 | 3072000 | ||
119930334 | exploorex | A | June 18, 2021, 9:42 p.m. | OK | Python 3 | TESTS | 31 | 62 | 614400 | ||
119953930 | pranay6751 | A | June 19, 2021, 5:56 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119952169 | 2019286 | A | June 19, 2021, 5:40 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119952028 | sh1194 | A | June 19, 2021, 5:38 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119951890 | saptarishimondal | A | June 19, 2021, 5:37 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119950992 | saagar0013 | A | June 19, 2021, 5:27 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119949039 | z_e_u_s | A | June 19, 2021, 5:07 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119944696 | lakshaysharma | A | June 19, 2021, 4:13 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119943322 | NMat | A | June 19, 2021, 3:53 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119939635 | shyguy99 | A | June 19, 2021, 2:54 a.m. | OK | Python 3 | TESTS | 31 | 77 | 0 | ||
119951855 | f7f7f7f7f7 | A | June 19, 2021, 5:36 a.m. | OK | Rust | TESTS | 31 | 31 | 0 | ||
119916253 | SorKierkegaard | A | June 18, 2021, 6:25 p.m. | OK | Rust | TESTS | 31 | 31 | 1024000 |
Back to search problems