Codeforces Round 841 (Div. 2) and Divide by Zero 2022

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
1731 Codeforces Round 841 (Div. 2) and Divide by Zero 2022 FINISHED False 7200 65114663 Dec. 27, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22798 ) A Joey Takes Money PROGRAMMING greedy math

B"Joey is low on money. His friend Chandler wants to lend Joey some money, but can't give him directly, as Joey is too proud of himself to accept it. So, in order to trick him, Chandler asks Joey to play a game. In this game, Chandler gives Joey an array a_1, a_2, ... , a_n ( n geq 2 ) of positive integers ( a_i ge 1 ). Joey can perform the following operation on the array any number of times: In the end, Joey will get the money equal to the sum of elements of the final array. Find the maximum amount of money mathrm{ans} Joey can get but print 2022 cdot mathrm{ans} . Why multiplied by 2022 ? Because we are never gonna see it again! It is guaranteed that the product of all the elements of the array a doesn't exceed 10^{12} . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 4000 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= q n <= q 50 ) -- the length of the array a . The second line contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q 10^6 ) -- the array itself. It's guaranteed that the product of all a_i doesn't exceed 10^{12} (i. e. a_1 cdot a_2 cdot ldots cdot a_n <= 10^{12} ). For each test case, print the maximum money Joey can get multiplied by 2022 . In the first test case, Joey can do the following: "...

Tutorials

Codeforces Round #841 (Div. 2) and Divide By Zero 2022 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
187073922 assoflame A Dec. 28, 2022, 7:23 p.m. OK C# 10 TESTS 10 92 3174400
187204897 tdawawd A Dec. 30, 2022, 5:13 a.m. OK Clang++17 Diagnostics TESTS 10 78 0
187179775 ph4ntm A Dec. 29, 2022, 7 p.m. OK Clang++17 Diagnostics TESTS 10 607 0
187447053 bkifhr8 A Dec. 31, 2022, 12:55 p.m. OK Clang++17 Diagnostics TESTS 10 607 0
187028177 ALC4121 A Dec. 28, 2022, 11:22 a.m. OK Clang++17 Diagnostics TESTS 10 654 0
187241366 gehlotbhopesh007 A Dec. 30, 2022, 12:39 p.m. OK Clang++17 Diagnostics TESTS 10 748 7372800
187466350 danpfei02 A Dec. 31, 2022, 4:45 p.m. OK Clang++20 Diagnostics TESTS 10 545 40345600
187242075 ec_zachly A Dec. 30, 2022, 12:46 p.m. OK Clang++20 Diagnostics TESTS 10 577 7372800
187445490 vjudge3 A Dec. 31, 2022, 12:38 p.m. OK Clang++20 Diagnostics TESTS 10 607 0
187446232 vjudge1 A Dec. 31, 2022, 12:46 p.m. OK Clang++20 Diagnostics TESTS 10 623 0
187040928 ttypist A Dec. 28, 2022, 1:41 p.m. OK Clang++20 Diagnostics TESTS 10 763 0
187233316 amaan_akhtar A Dec. 30, 2022, 11:08 a.m. OK GNU C11 TESTS 10 46 0
187463986 HMRahman A Dec. 31, 2022, 4:17 p.m. OK GNU C11 TESTS 10 46 0
187037861 anshikag020 A Dec. 28, 2022, 1:13 p.m. OK GNU C11 TESTS 10 46 0
187065204 Zabin_Hossain A Dec. 28, 2022, 5:43 p.m. OK GNU C11 TESTS 10 62 0
187126993 nishi_2021480 A Dec. 29, 2022, 10:36 a.m. OK GNU C11 TESTS 10 62 0
187173654 Lucifer.xt A Dec. 29, 2022, 5:55 p.m. OK GNU C11 TESTS 10 62 0
187371381 Harry_03 A Dec. 30, 2022, 5:37 p.m. OK GNU C11 TESTS 10 62 0
187095437 dcytrl A Dec. 29, 2022, 3:34 a.m. OK GNU C++14 TESTS 10 31 0
187424037 zstu22111ovo A Dec. 31, 2022, 8:30 a.m. OK GNU C++14 TESTS 10 31 0
187423003 DitaMirika A Dec. 31, 2022, 8:17 a.m. OK GNU C++14 TESTS 10 31 0
187223327 Galetx A Dec. 30, 2022, 9:12 a.m. OK GNU C++14 TESTS 10 31 0
187146652 cpchenpi A Dec. 29, 2022, 1:49 p.m. OK GNU C++14 TESTS 10 31 0
187451457 sy_ncx A Dec. 31, 2022, 1:45 p.m. OK GNU C++14 TESTS 10 31 0
187450476 Jerry__Jiang A Dec. 31, 2022, 1:34 p.m. OK GNU C++14 TESTS 10 31 0
187439899 zhi_fan A Dec. 31, 2022, 11:34 a.m. OK GNU C++14 TESTS 10 31 0
187216136 LZH2008 A Dec. 30, 2022, 7:46 a.m. OK GNU C++14 TESTS 10 31 3993600
187491250 Lazy23 A Jan. 1, 2023, 3:49 a.m. OK GNU C++14 TESTS 10 46 0
187252998 Selinanaho873 A Dec. 30, 2022, 2:35 p.m. OK GNU C++17 TESTS 10 31 0
187252996 Binaunetidwig435 A Dec. 30, 2022, 2:35 p.m. OK GNU C++17 TESTS 10 31 0
187252984 Neishacyanalij A Dec. 30, 2022, 2:35 p.m. OK GNU C++17 TESTS 10 31 0
187253350 Wackasteation A Dec. 30, 2022, 2:37 p.m. OK GNU C++17 TESTS 10 31 0
187446655 saber777 A Dec. 31, 2022, 12:51 p.m. OK GNU C++17 TESTS 10 31 0
187253078 Maboralmoti177 A Dec. 30, 2022, 2:36 p.m. OK GNU C++17 TESTS 10 31 0
187253038 Vangaroran A Dec. 30, 2022, 2:36 p.m. OK GNU C++17 TESTS 10 31 0
187253010 Yunnaruinida A Dec. 30, 2022, 2:35 p.m. OK GNU C++17 TESTS 10 31 0
187253025 Inajishicie160 A Dec. 30, 2022, 2:36 p.m. OK GNU C++17 TESTS 10 31 0
187253001 Ricisioek881 A Dec. 30, 2022, 2:35 p.m. OK GNU C++17 TESTS 10 31 0
187252917 Ldrasugiss A Dec. 30, 2022, 2:34 p.m. OK GNU C++17 (64) TESTS 10 15 0
187429433 proudzhao A Dec. 31, 2022, 9:32 a.m. OK GNU C++17 (64) TESTS 10 15 0
187253093 Malusbrig A Dec. 30, 2022, 2:36 p.m. OK GNU C++17 (64) TESTS 10 15 0
187253028 Chancwideenac263 A Dec. 30, 2022, 2:36 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252934 Rtisonaletha4 A Dec. 30, 2022, 2:34 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252892 Ongenarta A Dec. 30, 2022, 2:34 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252835 Avindmananne758 A Dec. 30, 2022, 2:33 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252770 Inyarnillel684 A Dec. 30, 2022, 2:33 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252631 Smianelat795 A Dec. 30, 2022, 2:32 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252617 Urileranun A Dec. 30, 2022, 2:32 p.m. OK GNU C++17 (64) TESTS 10 15 0
187252921 Malerinitale A Dec. 30, 2022, 2:34 p.m. OK GNU C++20 (64) TESTS 10 15 0
187252815 Isettinncics A Dec. 30, 2022, 2:33 p.m. OK GNU C++20 (64) TESTS 10 15 0
187252754 Esalgustahelta275 A Dec. 30, 2022, 2:33 p.m. OK GNU C++20 (64) TESTS 10 15 0
187252939 Clelinnnestal584 A Dec. 30, 2022, 2:34 p.m. OK GNU C++20 (64) TESTS 10 15 0
187253024 Gnarariartanjan530 A Dec. 30, 2022, 2:36 p.m. OK GNU C++20 (64) TESTS 10 15 0
187253138 Cyonitantase A Dec. 30, 2022, 2:36 p.m. OK GNU C++20 (64) TESTS 10 15 0
187441660 A_psycho A Dec. 31, 2022, 11:54 a.m. OK GNU C++20 (64) TESTS 10 15 0
187450224 Maaahi A Dec. 31, 2022, 1:31 p.m. OK GNU C++20 (64) TESTS 10 15 0
187483700 PsYch0Z A Dec. 31, 2022, 10:10 p.m. OK GNU C++20 (64) TESTS 10 15 0
187493130 Harsh_Chugh A Jan. 1, 2023, 4:48 a.m. OK GNU C++20 (64) TESTS 10 15 0
187232120 qiaowiwis A Dec. 30, 2022, 10:54 a.m. OK Go TESTS 10 62 102400
187160271 liangjiahui11 A Dec. 29, 2022, 3:49 p.m. OK Go TESTS 10 62 204800
187136524 procrastinate7 A Dec. 29, 2022, 12:12 p.m. OK Java 11 TESTS 10 171 0
187493891 crazycoder143 A Jan. 1, 2023, 5:09 a.m. OK Java 11 TESTS 10 186 0
187091608 SpringSwallows A Dec. 29, 2022, 1:40 a.m. OK Java 11 TESTS 10 186 0
187062083 WORTH A Dec. 28, 2022, 5:12 p.m. OK Java 11 TESTS 10 186 0
187042507 uttaran_das A Dec. 28, 2022, 1:55 p.m. OK Java 11 TESTS 10 187 0
187495793 rd37574 A Jan. 1, 2023, 5:55 a.m. OK Java 11 TESTS 10 202 0
187447348 mi7hata1 A Dec. 31, 2022, 12:59 p.m. OK Java 11 TESTS 10 202 0
187091508 SpringSwallows A Dec. 29, 2022, 1:36 a.m. OK Java 11 TESTS 10 202 0
187073336 daftdove A Dec. 28, 2022, 7:15 p.m. OK Java 11 TESTS 10 202 0
187039762 zzyisgarbage A Dec. 28, 2022, 1:31 p.m. OK Java 11 TESTS 10 202 0
187041374 im_Crush24 A Dec. 28, 2022, 1:45 p.m. OK Java 17 TESTS 10 234 41574400
187122203 tbs-jyy A Dec. 29, 2022, 9:44 a.m. OK Java 17 TESTS 10 248 102400
187154016 Matei_Stoian A Dec. 29, 2022, 2:52 p.m. OK Java 17 TESTS 10 249 0
187434942 Abdelrahim303 A Dec. 31, 2022, 10:35 a.m. OK Java 17 TESTS 10 249 819200
187212610 Kaju_ A Dec. 30, 2022, 7:02 a.m. OK Java 17 TESTS 10 265 512000
187210965 AC-Rush A Dec. 30, 2022, 6:41 a.m. OK Java 17 TESTS 10 390 0
187166981 anjalijha2504 A Dec. 29, 2022, 4:52 p.m. OK Java 17 TESTS 10 405 716800
187105122 plotemy A Dec. 29, 2022, 6:22 a.m. OK Java 17 TESTS 10 405 921600
187087995 Eslam_Saleh A Dec. 28, 2022, 11:18 p.m. OK Java 17 TESTS 10 405 921600
187048483 raunaksinghcoder A Dec. 28, 2022, 2:50 p.m. OK Java 17 TESTS 10 421 0
187173890 liheman A Dec. 29, 2022, 5:57 p.m. OK Java 8 TESTS 10 93 0
187241271 Mohamed308 A Dec. 30, 2022, 12:38 p.m. OK Java 8 TESTS 10 108 0
187449385 jkslyk A Dec. 31, 2022, 1:22 p.m. OK Java 8 TESTS 10 124 0
187399501 pradeep1999 A Dec. 31, 2022, 2:26 a.m. OK Java 8 TESTS 10 124 0
187034941 aggarwalanshul01 A Dec. 28, 2022, 12:32 p.m. OK Java 8 TESTS 10 124 0
187474780 ahmedTarek28 A Dec. 31, 2022, 6:32 p.m. OK Java 8 TESTS 10 139 0
187108974 SilveryZz A Dec. 29, 2022, 7:08 a.m. OK Java 8 TESTS 10 140 0
187475164 omarosama2114 A Dec. 31, 2022, 6:40 p.m. OK Java 8 TESTS 10 155 0
187054361 rational_fool A Dec. 28, 2022, 3:52 p.m. OK Java 8 TESTS 10 186 0
187037135 Rayhan_07 A Dec. 28, 2022, 1:03 p.m. OK Java 8 TESTS 10 280 0
187106387 Killer45 A Dec. 29, 2022, 6:38 a.m. OK Kotlin 1.7 TESTS 10 327 28262400
187229419 duckladydinh A Dec. 30, 2022, 10:23 a.m. OK Kotlin 1.7 TESTS 10 374 27852800
187157748 andpar A Dec. 29, 2022, 3:25 p.m. OK Kotlin 1.7 TESTS 10 483 59289600
187159853 andpar A Dec. 29, 2022, 3:45 p.m. OK Kotlin 1.7 TESTS 10 576 68710400
187043278 werner77 A Dec. 28, 2022, 2:02 p.m. OK Kotlin 1.7 TESTS 10 577 28774400
187131838 matsuko. A Dec. 29, 2022, 11:24 a.m. OK MS C++ 2017 TESTS 10 62 0
187371198 dallas0518 A Dec. 30, 2022, 5:33 p.m. OK MS C++ 2017 TESTS 10 124 0
187248895 gkin A Dec. 30, 2022, 1:55 p.m. OK MS C++ 2017 TESTS 10 139 0
187408733 harsh_1503 A Dec. 31, 2022, 5:33 a.m. OK MS C++ 2017 TESTS 10 140 0
187213169 adesh123 A Dec. 30, 2022, 7:09 a.m. OK MS C++ 2017 TESTS 10 140 0
187125895 Kway88 A Dec. 29, 2022, 10:25 a.m. OK MS C++ 2017 TESTS 10 140 0
187068609 McLetchik A Dec. 28, 2022, 6:17 p.m. OK MS C++ 2017 TESTS 10 155 0
187492058 fatant A Jan. 1, 2023, 4:15 a.m. OK MS C++ 2017 TESTS 10 156 0
187100472 Alex0304 A Dec. 29, 2022, 5:17 a.m. OK MS C++ 2017 TESTS 10 156 0
187086314 yash_452 A Dec. 28, 2022, 10:37 p.m. OK MS C++ 2017 TESTS 10 156 0
187238265 mohfasalih A Dec. 30, 2022, 12:07 p.m. OK PyPy 3 TESTS 10 156 5427200
187251387 Joshc A Dec. 30, 2022, 2:19 p.m. OK PyPy 3 TESTS 10 186 5836800
187096441 59ri A Dec. 29, 2022, 3:59 a.m. OK PyPy 3 TESTS 10 249 7168000
187249822 m.arush A Dec. 30, 2022, 2:04 p.m. OK PyPy 3 TESTS 10 264 7168000
187460705 Tynec A Dec. 31, 2022, 3:36 p.m. OK PyPy 3 TESTS 10 265 7168000
187188937 longdoan A Dec. 29, 2022, 9:35 p.m. OK PyPy 3 TESTS 10 265 7168000
187239010 meet3447 A Dec. 30, 2022, 12:15 p.m. OK PyPy 3 TESTS 10 280 7270400
187032273 ShujanS A Dec. 28, 2022, 12:05 p.m. OK PyPy 3 TESTS 10 280 8294400
187125146 abinaya_a A Dec. 29, 2022, 10:18 a.m. OK PyPy 3 TESTS 10 295 7168000
187056087 rsk9607 A Dec. 28, 2022, 4:10 p.m. OK PyPy 3 TESTS 10 358 8499200
187196983 SirMrGuy A Dec. 30, 2022, 2 a.m. OK PyPy 3-64 TESTS 10 77 3379200
187208088 kyoran A Dec. 30, 2022, 6:03 a.m. OK PyPy 3-64 TESTS 10 92 5529600
187045639 crapcode A Dec. 28, 2022, 2:23 p.m. OK PyPy 3-64 TESTS 10 93 5120000
187081455 RobinFromTheHood A Dec. 28, 2022, 9:05 p.m. OK PyPy 3-64 TESTS 10 93 5529600
187109588 anime_for_life A Dec. 29, 2022, 7:16 a.m. OK PyPy 3-64 TESTS 10 93 6144000
187066909 ArjitShrivastava A Dec. 28, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 10 108 6963200
187106117 adithya1207 A Dec. 29, 2022, 6:34 a.m. OK PyPy 3-64 TESTS 10 140 6860800
187227299 Mind_Reaper A Dec. 30, 2022, 9:58 a.m. OK PyPy 3-64 TESTS 10 140 7168000
187459934 bogocubic1 A Dec. 31, 2022, 3:27 p.m. OK PyPy 3-64 TESTS 10 140 9625600
187141611 InciteRage27 A Dec. 29, 2022, 1:03 p.m. OK PyPy 3-64 TESTS 10 155 6758400
187196940 SirMrGuy A Dec. 30, 2022, 1:59 a.m. OK Python 3 TESTS 10 108 204800
187248449 Anoxronk A Dec. 30, 2022, 1:51 p.m. OK Python 3 TESTS 10 109 0
187079859 mukiturrahman A Dec. 28, 2022, 8:41 p.m. OK Python 3 TESTS 10 109 0
187435063 Mo_alaa123 A Dec. 31, 2022, 10:36 a.m. OK Python 3 TESTS 10 124 0
187239371 .undefined. A Dec. 30, 2022, 12:19 p.m. OK Python 3 TESTS 10 124 0
187224945 fl_llbloom A Dec. 30, 2022, 9:31 a.m. OK Python 3 TESTS 10 124 0
187214223 Hot_Potato A Dec. 30, 2022, 7:21 a.m. OK Python 3 TESTS 10 124 0
187196877 SirMrGuy A Dec. 30, 2022, 1:57 a.m. OK Python 3 TESTS 10 124 0
187182019 baxx_ A Dec. 29, 2022, 7:29 p.m. OK Python 3 TESTS 10 124 0
187096466 BlueKayn29 A Dec. 29, 2022, 4 a.m. OK Python 3 TESTS 10 124 0
187247283 AhmadElRuby A Dec. 30, 2022, 1:39 p.m. OK Ruby 3 TESTS 10 311 102400
187198908 Benq A Dec. 30, 2022, 2:59 a.m. OK Rust 2021 TESTS 10 15 0
187111119 Spheniscine A Dec. 29, 2022, 7:35 a.m. OK Rust 2021 TESTS 10 31 102400
187063489 coffee-addict A Dec. 28, 2022, 5:26 p.m. OK Rust 2021 TESTS 10 31 102400
187226531 cottoncotton A Dec. 30, 2022, 9:49 a.m. OK Rust 2021 TESTS 10 31 67276800

remove filters

Back to search problems