Codeforces Round 784 (Div. 4)

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
1669 Codeforces Round 784 (Div. 4) FINISHED False 7200 86628263 April 21, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20148 ) H Maximal AND PROGRAMMING bitmasks greedy math 1300

B"Let mathsf{AND} denote the bitwise AND operation, and mathsf{OR} denote the bitwise OR operation. You are given an array a of length n and a non-negative integer k . You can perform at most k operations on the array of the following type: Output the maximum possible value of a_1 mathsf{AND} a_2 mathsf{AND} ... mathsf{AND} a_n after performing at most k operations. The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains the integers n and k ( 1 <= n <= 2 cdot 10^5 , 0 <= k <= 10^9 ). Then a single line follows, containing n integers describing the arrays a ( 0 <= q a_i < 2^{31} ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single line containing the maximum possible mathsf{AND} value of a_1 mathsf{AND} a_2 mathsf{AND} ... mathsf{AND} a_n after performing at most k operations. For the first test case, we can set the bit 1 ( 2^1 ) of the last 2 elements using the 2 operations, thus obtaining the array [ 2 , 3 , 3 ], which has mathsf{AND} value equal to 2 . For the second test case, we can't perform any operations so the answer is just the mathsf{AND} of the whole array which is 4 . "...

Tutorials

102101

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154772795 harsh6732 H April 23, 2022, 5:14 p.m. OK Clang++17 Diagnostics TESTS 14 1091 819200 1300
154734758 chenbxxx H April 23, 2022, 3:05 p.m. OK Clang++17 Diagnostics TESTS 14 1309 0 1300
154580062 ChenHuiyang H April 22, 2022, 4:57 p.m. OK Clang++17 Diagnostics TESTS 14 1403 10547200 1300
154502375 akshat211103 H April 22, 2022, 1:29 p.m. OK GNU C11 TESTS 14 140 1638400 1300
154817833 cunzai_zsy0531 H April 24, 2022, 6:54 a.m. OK GNU C++14 TESTS 14 30 2560000 1300
154607055 Hush H April 23, 2022, 1:14 a.m. OK GNU C++14 TESTS 14 46 0 1300
154646132 Afterglow. H April 23, 2022, 10:38 a.m. OK GNU C++14 TESTS 14 46 2150400 1300
154774945 mahersefo H April 23, 2022, 5:39 p.m. OK GNU C++14 TESTS 14 61 819200 1300
154613298 remmymilkyway H April 23, 2022, 3:44 a.m. OK GNU C++14 TESTS 14 61 819200 1300
154898352 youssef7ussien H April 25, 2022, 2:39 a.m. OK GNU C++14 TESTS 14 62 0 1300
154578222 xXDrakosXx H April 22, 2022, 4:44 p.m. OK GNU C++14 TESTS 14 62 0 1300
154654791 namangpt2312 H April 23, 2022, 12:17 p.m. OK GNU C++14 TESTS 14 62 819200 1300
154839055 itytwt H April 24, 2022, 10:50 a.m. OK GNU C++14 TESTS 14 62 819200 1300
154835584 aj_jeet H April 24, 2022, 10:07 a.m. OK GNU C++14 TESTS 14 62 819200 1300
154531114 sortslave H April 22, 2022, 3:01 p.m. OK GNU C++17 TESTS 14 61 0 1300
154623002 deCooK H April 23, 2022, 6:17 a.m. OK GNU C++17 TESTS 14 61 819200 1300
154503799 094_shanoor H April 22, 2022, 1:44 p.m. OK GNU C++17 TESTS 14 61 819200 1300
154637143 IslamMohsen165 H April 23, 2022, 9:01 a.m. OK GNU C++17 TESTS 14 62 0 1300
154872567 Bazzinga_ H April 24, 2022, 4:11 p.m. OK GNU C++17 TESTS 14 62 0 1300
154815705 nozeno H April 24, 2022, 6:27 a.m. OK GNU C++17 TESTS 14 62 0 1300
154773190 nayeem_bd H April 23, 2022, 5:22 p.m. OK GNU C++17 TESTS 14 62 0 1300
154717451 ksaweryr H April 23, 2022, 2:33 p.m. OK GNU C++17 TESTS 14 62 0 1300
154648725 ZiyadHassan500 H April 23, 2022, 11:07 a.m. OK GNU C++17 TESTS 14 62 0 1300
154504918 HeeJaYaa H April 22, 2022, 1:55 p.m. OK GNU C++17 TESTS 14 62 0 1300
154871482 Inzam_Z H April 24, 2022, 4 p.m. OK GNU C++17 (64) TESTS 14 46 0 1300
154534932 vjudge4 H April 22, 2022, 3:06 p.m. OK GNU C++17 (64) TESTS 14 46 0 1300
154502363 Meteor_Z H April 22, 2022, 1:29 p.m. OK GNU C++17 (64) TESTS 14 46 0 1300
154493827 jk-jung H April 22, 2022, 12:01 p.m. OK GNU C++17 (64) TESTS 14 46 0 1300
154655975 xprezzzboi H April 23, 2022, 12:30 p.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154627991 pointN H April 23, 2022, 7:12 a.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154596157 Wielomian H April 22, 2022, 8:33 p.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154592030 DanielVillota16 H April 22, 2022, 7:29 p.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154827716 Ash_Dr H April 24, 2022, 8:40 a.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154803228 fakhoury H April 24, 2022, 2:58 a.m. OK GNU C++17 (64) TESTS 14 46 819200 1300
154666768 shuitishashou H April 23, 2022, 12:48 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154650457 HideInTheSea H April 23, 2022, 11:27 a.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154579858 bakekaga H April 22, 2022, 4:56 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154579252 Dat_Huynh H April 22, 2022, 4:51 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154892573 cotx H April 24, 2022, 9:50 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154821028 achvanov H April 24, 2022, 7:27 a.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154809736 Dingovinaa H April 24, 2022, 5:08 a.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154741357 alikkrch H April 23, 2022, 3:22 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154682223 happypotato1207 H April 23, 2022, 1:16 p.m. OK GNU C++20 (64) TESTS 14 31 819200 1300
154645767 -pandey_shivam- H April 23, 2022, 10:34 a.m. OK GNU C++20 (64) TESTS 14 31 1638400 1300
154627601 LanceTheDragonTrainer H April 23, 2022, 7:07 a.m. OK Java 11 TESTS 14 202 0 1300
154834155 _alpaca H April 24, 2022, 9:50 a.m. OK Java 11 TESTS 14 218 3072000 1300
154623413 sf14t H April 23, 2022, 6:22 a.m. OK Java 11 TESTS 14 233 0 1300
154580939 UttamS H April 22, 2022, 5:05 p.m. OK Java 11 TESTS 14 233 3072000 1300
154668611 legit_123 H April 23, 2022, 12:56 p.m. OK Java 11 TESTS 14 249 0 1300
154590728 amritagg H April 22, 2022, 7:09 p.m. OK Java 11 TESTS 14 249 3072000 1300
154646257 yudi23 H April 23, 2022, 10:39 a.m. OK Java 11 TESTS 14 249 3174400 1300
154505322 Srikanth1777 H April 22, 2022, 1:59 p.m. OK Java 11 TESTS 14 249 3174400 1300
154501049 MindSlayer H April 22, 2022, 1:15 p.m. OK Java 11 TESTS 14 249 3174400 1300
154591286 Aaryendra H April 22, 2022, 7:17 p.m. OK Java 11 TESTS 14 265 3379200 1300
154629141 ND_ H April 23, 2022, 7:25 a.m. OK Java 8 TESTS 14 124 0 1300
154786532 DEMO23 H April 23, 2022, 8:08 p.m. OK Java 8 TESTS 14 139 0 1300
154628410 leonlian H April 23, 2022, 7:16 a.m. OK Java 8 TESTS 14 171 11161600 1300
154703074 Belal_Abouraya H April 23, 2022, 2:15 p.m. OK Java 8 TESTS 14 171 11161600 1300
154657437 Diaa12360 H April 23, 2022, 12:38 p.m. OK Java 8 TESTS 14 186 11161600 1300
154649260 ak_ankit H April 23, 2022, 11:13 a.m. OK Java 8 TESTS 14 186 11673600 1300
154810457 ssingh0271 H April 24, 2022, 5:18 a.m. OK Java 8 TESTS 14 186 29491200 1300
154501978 govindrajput H April 22, 2022, 1:24 p.m. OK Java 8 TESTS 14 202 11366400 1300
154857865 AbdelrahmanFathy H April 24, 2022, 1:43 p.m. OK Java 8 TESTS 14 202 81408000 1300
154780542 rohithorchu13 H April 23, 2022, 6:38 p.m. OK Java 8 TESTS 14 389 0 1300
154503557 mikasamikoto H April 22, 2022, 1:41 p.m. OK MS C++ 2017 TESTS 14 186 819200 1300
154796543 Weylyn H April 23, 2022, 11:49 p.m. OK MS C++ 2017 TESTS 14 202 819200 1300
154758229 vishvjoshi H April 23, 2022, 4:14 p.m. OK MS C++ 2017 TESTS 14 218 1638400 1300
154758959 vishvjoshi H April 23, 2022, 4:17 p.m. OK MS C++ 2017 TESTS 14 218 1638400 1300
154587427 AlexeyT H April 22, 2022, 6:22 p.m. OK MS C++ 2017 TESTS 14 233 0 1300
154492688 CtrlACtrlV H April 22, 2022, 11:50 a.m. OK MS C++ 2017 TESTS 14 234 100966400 1300
154502367 mikasamikoto H April 22, 2022, 1:29 p.m. OK MS C++ 2017 TESTS 14 249 0 1300
154791647 theinvasian H April 23, 2022, 9:41 p.m. OK MS C++ 2017 TESTS 14 280 0 1300
154873739 Tangerine H April 24, 2022, 4:25 p.m. OK MS C++ 2017 TESTS 14 343 1638400 1300
154498886 markusb88 H April 22, 2022, 12:52 p.m. OK .NET Core C# TESTS 14 124 24780800 1300
154562763 Lectra H April 22, 2022, 4 p.m. OK .NET Core C# TESTS 14 124 25804800 1300
154505754 expectation00 H April 22, 2022, 2:04 p.m. OK Node.js TESTS 14 171 28979200 1300
154790827 acorn11 H April 23, 2022, 9:24 p.m. OK PyPy 2 TESTS 14 155 12595200 1300
154561552 Anadi H April 22, 2022, 3:57 p.m. OK PyPy 3 TESTS 14 342 18432000 1300
154769279 Midhilesh H April 23, 2022, 4:56 p.m. OK PyPy 3 TESTS 14 343 18636800 1300
154711972 osama_a_rehman H April 23, 2022, 2:25 p.m. OK PyPy 3 TESTS 14 374 18329600 1300
154834782 artifexbm H April 24, 2022, 9:58 a.m. OK PyPy 3 TESTS 14 576 109158400 1300
154502105 nitish420 H April 22, 2022, 1:26 p.m. OK PyPy 3-64 TESTS 14 139 28876800 1300
154852656 Andrei_Kuz H April 24, 2022, 12:51 p.m. OK PyPy 3-64 TESTS 14 202 27750400 1300
154765375 IuxMorti H April 23, 2022, 4:41 p.m. OK PyPy 3-64 TESTS 14 264 28467200 1300
154589597 KabirIvan H April 22, 2022, 6:52 p.m. OK PyPy 3-64 TESTS 14 296 18739200 1300
154497195 Gorzorg H April 22, 2022, 12:35 p.m. OK PyPy 3-64 TESTS 14 296 27955200 1300
154503380 koder_786 H April 22, 2022, 1:39 p.m. OK PyPy 3-64 TESTS 14 296 28364800 1300
154645312 De-Bug H April 23, 2022, 10:29 a.m. OK PyPy 3-64 TESTS 14 296 28467200 1300
154608107 Nan-Do H April 23, 2022, 1:40 a.m. OK PyPy 3-64 TESTS 14 296 28467200 1300
154764141 coder3433 H April 23, 2022, 4:36 p.m. OK PyPy 3-64 TESTS 14 296 29900800 1300
154615589 Kiri11 H April 23, 2022, 4:32 a.m. OK PyPy 3-64 TESTS 14 296 30412800 1300
154592610 coderbd H April 22, 2022, 7:39 p.m. OK Python 3 TESTS 14 1341 17715200 1300
154852707 Andrei_Kuz H April 24, 2022, 12:52 p.m. OK Python 3 TESTS 14 1434 15769600 1300
154852682 Andrei_Kuz H April 24, 2022, 12:52 p.m. OK Python 3 TESTS 14 1466 17817600 1300
154666752 pizet H April 23, 2022, 12:48 p.m. OK Python 3 TESTS 14 1481 14233600 1300
154817807 nathanivanshaj H April 24, 2022, 6:53 a.m. OK Python 3 TESTS 14 1575 21913600 1300
154899485 prudentia H April 25, 2022, 3:05 a.m. OK Python 3 TESTS 14 1762 16793600 1300
154653879 axe98 H April 23, 2022, 12:05 p.m. OK Python 3 TESTS 14 1762 17817600 1300
154589501 A.Khwari H April 22, 2022, 6:50 p.m. OK Python 3 TESTS 14 1777 17817600 1300
154621469 sushanthgrandhi H April 23, 2022, 6:01 a.m. OK Python 3 TESTS 14 1809 17817600 1300
154621785 sushanthgrandhi H April 23, 2022, 6:04 a.m. OK Python 3 TESTS 14 1824 17817600 1300
154542591 noviceli H April 22, 2022, 3:18 p.m. OK Rust 2021 TESTS 14 46 6246400 1300
154595010 DeadFox H April 22, 2022, 8:16 p.m. OK Rust 2021 TESTS 14 46 7065600 1300
154781758 RunGood H April 23, 2022, 6:56 p.m. OK Rust 2021 TESTS 14 62 8089600 1300

remove filters

Back to search problems