Codeforces Round 838 (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
1762 Codeforces Round 838 (Div. 2) FINISHED False 9000 66151463 Dec. 15, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 19476 ) A Divide and Conquer PROGRAMMING greedy math number theory

B'An array b is good if the sum of elements of b is even. You are given an array a consisting of n positive integers. In one operation, you can select an index i and change a_i := lfloor frac{a_i}{2} rfloor . ^ dagger Find the minimum number of operations (possibly 0 ) needed to make a good. It can be proven that it is always possible to make a good. ^ dagger lfloor x rfloor denotes the floor function -- the largest integer less than or equal to x . For example, lfloor 2.7 rfloor = 2 , lfloor pi rfloor = 3 and lfloor 5 rfloor =5 . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 50 ) -- the length of the array a . The second line of each test case contains n space-separated integers a_1,a_2, ldots,a_n ( 1 <= q a_i <= q 10^6 ) -- representing the array a . Do note that the sum of n over all test cases is not bounded. For each test case, output the minimum number of operations needed to make a good. In the first test case, array a is already good. In the second test case, we can perform on index 2 twice. After the first operation, array a becomes [7,2] . After performing on index 2 again, a becomes [7,1] , which is good. It can be proved that it is not possible to make a good in less number of operations. In the third test case, a becomes [0,2,4] if we perform the operation on index 1 once. As [0,2,4] is good, answer is 1 . In the fourth test case, we need to perform the operation on index 1 four times. After all operations, a becomes [0] . It can be proved that it is not possible to make a good in '...

Tutorials

Codeforces Round #838 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
185378994 absa1am A Dec. 15, 2022, 6:13 p.m. OK C# 10 TESTS 4 46 2867200
185398412 bluemegane A Dec. 15, 2022, 10:38 p.m. OK C# 8 TESTS 4 77 2969600
185375092 Rimond12345 A Dec. 15, 2022, 5:44 p.m. OK C# 8 TESTS 4 93 3481600
185415905 Rifatr A Dec. 16, 2022, 5:31 a.m. OK Clang++20 Diagnostics TESTS 4 295 2150400
185416900 Rifatr A Dec. 16, 2022, 5:44 a.m. OK Clang++20 Diagnostics TESTS 4 327 2150400
185379106 WK_Siyam A Dec. 15, 2022, 6:14 p.m. OK GNU C11 TESTS 4 15 0
185402343 Warriorkhalid A Dec. 16, 2022, 12:41 a.m. OK GNU C11 TESTS 4 15 0
185408085 Interested A Dec. 16, 2022, 3:16 a.m. OK GNU C11 TESTS 4 15 0
185368334 DG2022 A Dec. 15, 2022, 5:01 p.m. OK GNU C11 TESTS 4 15 0
185365146 HVD_160 A Dec. 15, 2022, 4:52 p.m. OK GNU C11 TESTS 4 15 0
185384770 kabirsumaiya A Dec. 15, 2022, 7:05 p.m. OK GNU C11 TESTS 4 30 0
185362074 LN697 A Dec. 15, 2022, 4:43 p.m. OK GNU C11 TESTS 4 30 7987200
185383161 namanpahwa20 A Dec. 15, 2022, 6:48 p.m. OK GNU C11 TESTS 4 31 0
185362334 Md._Asif_Samrat A Dec. 15, 2022, 4:44 p.m. OK GNU C11 TESTS 4 31 0
185383703 winwinry A Dec. 15, 2022, 6:53 p.m. OK GNU C11 TESTS 4 31 0
185409654 lyuzlion A Dec. 16, 2022, 3:51 a.m. OK GNU C++14 TESTS 4 0 0
185407192 soumikkvb A Dec. 16, 2022, 2:53 a.m. OK GNU C++14 TESTS 4 0 102400
185408466 niyiqi A Dec. 16, 2022, 3:24 a.m. OK GNU C++14 TESTS 4 15 0
185415108 prateekgoelprogrammer2 A Dec. 16, 2022, 5:21 a.m. OK GNU C++14 TESTS 4 15 0
185414672 suvashkumar A Dec. 16, 2022, 5:15 a.m. OK GNU C++14 TESTS 4 15 0
185413197 matrix.mk2 A Dec. 16, 2022, 4:53 a.m. OK GNU C++14 TESTS 4 15 0
185411806 Vistral A Dec. 16, 2022, 4:30 a.m. OK GNU C++14 TESTS 4 15 0
185410392 Sumit_73 A Dec. 16, 2022, 4:06 a.m. OK GNU C++14 TESTS 4 15 0
185408960 wust-zzl A Dec. 16, 2022, 3:36 a.m. OK GNU C++14 TESTS 4 15 0
185408838 CaoBaoHoangMSU A Dec. 16, 2022, 3:33 a.m. OK GNU C++14 TESTS 4 15 0
185410894 AlgoDragon_ A Dec. 16, 2022, 4:15 a.m. OK GNU C++17 TESTS 4 0 0
185405556 klahsiv A Dec. 16, 2022, 2:13 a.m. OK GNU C++17 TESTS 4 0 0
185376591 Arittra202 A Dec. 15, 2022, 5:55 p.m. OK GNU C++17 TESTS 4 0 102400
185400842 hackysack A Dec. 15, 2022, 11:50 p.m. OK GNU C++17 TESTS 4 0 102400
185374242 Musfiqur A Dec. 15, 2022, 5:39 p.m. OK GNU C++17 TESTS 4 0 102400
185405477 samarthmayya A Dec. 16, 2022, 2:12 a.m. OK GNU C++17 TESTS 4 0 102400
185407451 Flatday A Dec. 16, 2022, 3 a.m. OK GNU C++17 TESTS 4 0 102400
185416947 4tran A Dec. 16, 2022, 5:45 a.m. OK GNU C++17 TESTS 4 15 0
185416694 paengjiwon A Dec. 16, 2022, 5:42 a.m. OK GNU C++17 TESTS 4 15 0
185417675 surajmisal18 A Dec. 16, 2022, 5:54 a.m. OK GNU C++17 TESTS 4 15 0
185378823 ilia_rr A Dec. 15, 2022, 6:12 p.m. OK GNU C++17 (64) TESTS 4 0 0
185375554 _BugSlayer_ A Dec. 15, 2022, 5:48 p.m. OK GNU C++17 (64) TESTS 4 0 0
185406315 1potato2potato A Dec. 16, 2022, 2:32 a.m. OK GNU C++17 (64) TESTS 4 0 0
185413552 Tanphoon A Dec. 16, 2022, 4:59 a.m. OK GNU C++17 (64) TESTS 4 15 0
185412237 _fazik_ A Dec. 16, 2022, 4:37 a.m. OK GNU C++17 (64) TESTS 4 15 0
185411580 cuzperf A Dec. 16, 2022, 4:26 a.m. OK GNU C++17 (64) TESTS 4 15 0
185408793 MoNir_ A Dec. 16, 2022, 3:32 a.m. OK GNU C++17 (64) TESTS 4 15 0
185408571 fictitious_love A Dec. 16, 2022, 3:27 a.m. OK GNU C++17 (64) TESTS 4 15 0
185408317 Huntik_03 A Dec. 16, 2022, 3:21 a.m. OK GNU C++17 (64) TESTS 4 15 0
185418269 mahbubhasanmht A Dec. 16, 2022, 6:01 a.m. OK GNU C++17 (64) TESTS 4 15 0
185405805 borademirtas A Dec. 16, 2022, 2:19 a.m. OK GNU C++20 (64) TESTS 4 0 0
185417509 Siddharth2EEE A Dec. 16, 2022, 5:51 a.m. OK GNU C++20 (64) TESTS 4 0 0
185411324 anuj2021 A Dec. 16, 2022, 4:22 a.m. OK GNU C++20 (64) TESTS 4 0 0
185409336 ___MAHBUB___ A Dec. 16, 2022, 3:45 a.m. OK GNU C++20 (64) TESTS 4 0 0
185408005 ayush567 A Dec. 16, 2022, 3:14 a.m. OK GNU C++20 (64) TESTS 4 0 0
185407929 Gevin A Dec. 16, 2022, 3:12 a.m. OK GNU C++20 (64) TESTS 4 0 0
185407548 daredsakura1 A Dec. 16, 2022, 3:03 a.m. OK GNU C++20 (64) TESTS 4 0 0
185407247 130229nbnb A Dec. 16, 2022, 2:55 a.m. OK GNU C++20 (64) TESTS 4 0 0
185405939 Rinors A Dec. 16, 2022, 2:23 a.m. OK GNU C++20 (64) TESTS 4 0 0
185393921 Amrharb A Dec. 15, 2022, 9:01 p.m. OK GNU C++20 (64) TESTS 4 0 0
185391804 nis1234 A Dec. 15, 2022, 8:30 p.m. OK Java 11 TESTS 4 155 0
185375139 Spidey2182 A Dec. 15, 2022, 5:45 p.m. OK Java 11 TESTS 4 155 0
185415920 __Serendipity A Dec. 16, 2022, 5:31 a.m. OK Java 11 TESTS 4 171 0
185395431 Yousef_Badr A Dec. 15, 2022, 9:29 p.m. OK Java 11 TESTS 4 171 0
185379710 yadavdipesh A Dec. 15, 2022, 6:19 p.m. OK Java 11 TESTS 4 171 0
185400126 iknownothing13 A Dec. 15, 2022, 11:27 p.m. OK Java 11 TESTS 4 186 0
185384134 berniie1818 A Dec. 15, 2022, 6:58 p.m. OK Java 11 TESTS 4 187 0
185381464 qw_er__ty A Dec. 15, 2022, 6:33 p.m. OK Java 11 TESTS 4 187 39321600
185390499 doomhammer. A Dec. 15, 2022, 8:13 p.m. OK Java 11 TESTS 4 202 0
185385190 rohit_8469 A Dec. 15, 2022, 7:09 p.m. OK Java 11 TESTS 4 202 0
185413620 KarMa_ A Dec. 16, 2022, 5 a.m. OK Java 17 TESTS 4 171 0
185375460 Saw_you A Dec. 15, 2022, 5:47 p.m. OK Java 17 TESTS 4 171 0
185408515 pili A Dec. 16, 2022, 3:26 a.m. OK Java 17 TESTS 4 187 0
185379274 Dev.Zaki A Dec. 15, 2022, 6:15 p.m. OK Java 17 TESTS 4 187 716800
185376735 yashbhardwaj24 A Dec. 15, 2022, 5:56 p.m. OK Java 17 TESTS 4 202 0
185411932 _lwq_123_ A Dec. 16, 2022, 4:32 a.m. OK Java 17 TESTS 4 217 0
185376539 ayushmandal0122 A Dec. 15, 2022, 5:55 p.m. OK Java 17 TESTS 4 217 512000
185406427 iamJatinYadav A Dec. 16, 2022, 2:35 a.m. OK Java 17 TESTS 4 218 512000
185380684 Suraj1607 A Dec. 15, 2022, 6:26 p.m. OK Java 17 TESTS 4 218 614400
185381395 merlin_ A Dec. 15, 2022, 6:32 p.m. OK Java 17 TESTS 4 233 512000
185403648 ikillmyself A Dec. 16, 2022, 1:19 a.m. OK Java 8 TESTS 4 93 0
185400738 liheman A Dec. 15, 2022, 11:46 p.m. OK Java 8 TESTS 4 93 0
185379386 ItsZaki A Dec. 15, 2022, 6:16 p.m. OK Java 8 TESTS 4 93 0
185380319 ItsZaki A Dec. 15, 2022, 6:23 p.m. OK Java 8 TESTS 4 108 0
185372441 Rohinth A Dec. 15, 2022, 5:29 p.m. OK Java 8 TESTS 4 109 0
185402520 omeganot A Dec. 16, 2022, 12:46 a.m. OK Java 8 TESTS 4 109 38195200
185378664 ItsZaki A Dec. 15, 2022, 6:11 p.m. OK Java 8 TESTS 4 124 0
185366252 dunkaditya A Dec. 15, 2022, 4:55 p.m. OK Java 8 TESTS 4 139 0
185368475 Shishir47 A Dec. 15, 2022, 5:01 p.m. OK Java 8 TESTS 4 140 54681600
185376642 harshpanwar1705 A Dec. 15, 2022, 5:55 p.m. OK Java 8 TESTS 4 155 0
185363609 AnikaMundhada A Dec. 15, 2022, 4:48 p.m. OK MS C++ 2017 TESTS 4 15 0
185409898 njnuqy A Dec. 16, 2022, 3:57 a.m. OK MS C++ 2017 TESTS 4 46 0
185384197 shorya1835 A Dec. 15, 2022, 6:58 p.m. OK MS C++ 2017 TESTS 4 46 0
185369482 cv7xz A Dec. 15, 2022, 5:03 p.m. OK MS C++ 2017 TESTS 4 46 0
185405624 caiji_liu A Dec. 16, 2022, 2:15 a.m. OK MS C++ 2017 TESTS 4 46 102400
185410320 GRccc A Dec. 16, 2022, 4:05 a.m. OK MS C++ 2017 TESTS 4 62 0
185375515 Aksurana A Dec. 15, 2022, 5:47 p.m. OK MS C++ 2017 TESTS 4 62 0
185386385 availablegreen A Dec. 15, 2022, 7:22 p.m. OK Node.js TESTS 4 109 33792000
185377479 rsFalse A Dec. 15, 2022, 6:02 p.m. OK Perl TESTS 4 109 0
185383285 n.n.n.kz A Dec. 15, 2022, 6:49 p.m. OK PHP TESTS 4 62 0
185378953 Su_123 A Dec. 15, 2022, 6:13 p.m. OK PyPy 3 TESTS 4 170 5222400
185394990 WalrusRamen21 A Dec. 15, 2022, 9:20 p.m. OK PyPy 3 TESTS 4 187 7270400
185372171 harshini.paranjape A Dec. 15, 2022, 5:28 p.m. OK PyPy 3 TESTS 4 233 9625600
185376715 fntfaizan A Dec. 15, 2022, 5:56 p.m. OK PyPy 3 TESTS 4 264 5836800
185377648 fntfaizan A Dec. 15, 2022, 6:03 p.m. OK PyPy 3 TESTS 4 264 6144000
185416709 MenaceJn A Dec. 16, 2022, 5:42 a.m. OK PyPy 3-64 TESTS 4 93 3788800
185397714 Trem0r A Dec. 15, 2022, 10:20 p.m. OK PyPy 3-64 TESTS 4 93 4505600
185412829 FrozenKandy A Dec. 16, 2022, 4:47 a.m. OK PyPy 3-64 TESTS 4 93 5529600
185373936 CinaDor A Dec. 15, 2022, 5:37 p.m. OK PyPy 3-64 TESTS 4 93 6246400
185378298 rishabh_45 A Dec. 15, 2022, 6:08 p.m. OK PyPy 3-64 TESTS 4 93 11571200
185382727 SophieHatter A Dec. 15, 2022, 6:44 p.m. OK PyPy 3-64 TESTS 4 108 4198400
185387304 aneesh2002 A Dec. 15, 2022, 7:34 p.m. OK PyPy 3-64 TESTS 4 108 5017600
185387243 RaghavGupta22 A Dec. 15, 2022, 7:33 p.m. OK PyPy 3-64 TESTS 4 108 5939200
185407190 generalPurpose A Dec. 16, 2022, 2:53 a.m. OK PyPy 3-64 TESTS 4 109 5324800
185404663 gesuta A Dec. 16, 2022, 1:49 a.m. OK PyPy 3-64 TESTS 4 109 5734400
185406964 Rahulsust A Dec. 16, 2022, 2:48 a.m. OK Python 3 TESTS 4 109 0
185394482 Rujul A Dec. 15, 2022, 9:11 p.m. OK Python 3 TESTS 4 109 0
185376988 softwarengineer24 A Dec. 15, 2022, 5:58 p.m. OK Python 3 TESTS 4 109 102400
185412388 softwarengineer24 A Dec. 16, 2022, 4:39 a.m. OK Python 3 TESTS 4 124 0
185395605 sveleh1977 A Dec. 15, 2022, 9:32 p.m. OK Python 3 TESTS 4 140 0
185400594 kollabhargavre1 A Dec. 15, 2022, 11:42 p.m. OK Python 3 TESTS 4 155 0
185395830 wallsgreen A Dec. 15, 2022, 9:37 p.m. OK Python 3 TESTS 4 155 0
185379231 alex_777 A Dec. 15, 2022, 6:15 p.m. OK Python 3 TESTS 4 155 0
185406374 dmnewone A Dec. 16, 2022, 2:33 a.m. OK Python 3 TESTS 4 156 0
185409745 2009amit0509 A Dec. 16, 2022, 3:53 a.m. OK Python 3 TESTS 4 171 0
185385450 liut A Dec. 15, 2022, 7:12 p.m. OK Rust 2021 TESTS 4 0 0
185386516 Swordelf A Dec. 15, 2022, 7:24 p.m. OK Rust 2021 TESTS 4 15 0

remove filters

Back to search problems