Codeforces Round 871 (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
1829 Codeforces Round 871 (Div. 4) FINISHED False 8100 48439499 May 6, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7896 ) H Don't Blame Me PROGRAMMING bitmasks combinatorics dp math 1700

B"Sadly, the problem setter couldn't think of an interesting story, thus he just asks you to solve the following problem. Given an array a consisting of n positive integers, count the number of non-empty subsequences for which the bitwise mathsf{AND} of the elements in the subsequence has exactly k set bits in its binary representation. The answer may be large, so output it modulo 10^9+7 . Recall that the subsequence of an array a is a sequence that can be obtained from a by removing some (possibly, zero) elements. For example, [1, 2, 3] , [3] , [1, 3] are subsequences of [1, 2, 3] , but [3, 2] and [4, 5, 6] are not. Note that mathsf{AND} represents the bitwise AND operation. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case consists of two integers n and k ( 1 <= q n <= q 2 cdot 10^5 , 0 <= k <= 6 ) -- the length of the array and the number of set bits that the bitwise mathsf{AND} the counted subsequences should have in their binary representation. The second line of each test case consists of n integers a_i ( 0 <= q a_i <= q 63 ) -- the array a . It is guaranteed that the sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, output a single integer -- the number of subsequences that have exactly k set bits in their bitwise mathsf{AND} value's binary representation. The answer may be large, so output it modulo 10^9+7 . "...

Tutorials

Codeforces Round 871 (Div. 4) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
205832317 tahtarovserver H May 14, 2023, 12:38 p.m. OK C# 8 TESTS 15 280 75264000 1700
205535648 Pavan125 H May 12, 2023, 12:36 p.m. OK GNU C++14 TESTS 15 46 0 1700
205755735 OAleksa H May 13, 2023, 6:45 p.m. OK GNU C++14 TESTS 15 61 819200 1700
206062822 lamentropetion H May 16, 2023, 8:32 a.m. OK GNU C++14 TESTS 15 62 0 1700
206285370 moinulovi10 H May 17, 2023, 11:27 p.m. OK GNU C++14 TESTS 15 62 819200 1700
206058085 Amireza H May 16, 2023, 7:31 a.m. OK GNU C++14 TESTS 15 77 103424000 1700
206414000 kdymiotis H May 19, 2023, 7:07 a.m. OK GNU C++14 TESTS 15 93 52121600 1700
206070277 S-longod H May 16, 2023, 9:51 a.m. OK GNU C++14 TESTS 15 108 52121600 1700
205778158 eds1 H May 14, 2023, 3 a.m. OK GNU C++14 TESTS 15 139 52121600 1700
206282549 myst-6 H May 17, 2023, 9:42 p.m. OK GNU C++14 TESTS 15 140 0 1700
205696351 ckq328 H May 13, 2023, 9:02 a.m. OK GNU C++14 TESTS 15 140 1638400 1700
205939262 neerajam H May 15, 2023, 4:11 a.m. OK GNU C++17 TESTS 15 46 0 1700
205547113 2000032071 H May 12, 2023, 2:21 p.m. OK GNU C++17 TESTS 15 46 0 1700
206429246 varma99 H May 19, 2023, 9:40 a.m. OK GNU C++17 TESTS 15 62 0 1700
206343861 ishaque28 H May 18, 2023, 1:13 p.m. OK GNU C++17 TESTS 15 62 0 1700
206207107 hotteafun H May 17, 2023, 12:05 p.m. OK GNU C++17 TESTS 15 62 0 1700
206040659 shibam_2002 H May 16, 2023, 2:46 a.m. OK GNU C++17 TESTS 15 62 0 1700
206314231 celin H May 18, 2023, 8:29 a.m. OK GNU C++17 TESTS 15 62 3993600 1700
205966555 bkifhr9 H May 15, 2023, 10:11 a.m. OK GNU C++17 TESTS 15 78 819200 1700
205809476 _SwaRaj H May 14, 2023, 8:55 a.m. OK GNU C++17 TESTS 15 78 819200 1700
205615155 jahnavi-21 H May 12, 2023, 4:28 p.m. OK GNU C++17 TESTS 15 78 819200 1700
206275078 rivalq H May 17, 2023, 7:01 p.m. OK GNU C++17 (64) TESTS 15 46 0 1700
206383111 mircea_007 H May 18, 2023, 7:53 p.m. OK GNU C++17 (64) TESTS 15 46 716800 1700
206335476 euoao H May 18, 2023, 11:55 a.m. OK GNU C++17 (64) TESTS 15 46 819200 1700
206160584 OTTFF H May 16, 2023, 11:24 p.m. OK GNU C++17 (64) TESTS 15 46 819200 1700
206448178 Oinng H May 19, 2023, 12:55 p.m. OK GNU C++17 (64) TESTS 15 62 0 1700
206345509 Hangbust H May 18, 2023, 1:28 p.m. OK GNU C++17 (64) TESTS 15 62 3174400 1700
206296970 Wmic. H May 18, 2023, 4:43 a.m. OK GNU C++17 (64) TESTS 15 62 51302400 1700
206001816 Vax H May 15, 2023, 3:19 p.m. OK GNU C++17 (64) TESTS 15 78 1638400 1700
206255272 lalith_6055 H May 17, 2023, 5:23 p.m. OK GNU C++17 (64) TESTS 15 93 0 1700
206223356 GudeGude H May 17, 2023, 2:33 p.m. OK GNU C++17 (64) TESTS 15 109 52019200 1700
206407684 khanhtai H May 19, 2023, 5:48 a.m. OK GNU C++20 (64) TESTS 15 31 0 1700
206019034 BlueDiamond H May 15, 2023, 6:21 p.m. OK GNU C++20 (64) TESTS 15 31 0 1700
205738551 Ckcyi H May 13, 2023, 3:53 p.m. OK GNU C++20 (64) TESTS 15 31 0 1700
206340428 AryanReddy H May 18, 2023, 12:39 p.m. OK GNU C++20 (64) TESTS 15 31 819200 1700
206444310 luogu_bot2 H May 19, 2023, 12:17 p.m. OK GNU C++20 (64) TESTS 15 46 0 1700
206444181 luogu_bot4 H May 19, 2023, 12:16 p.m. OK GNU C++20 (64) TESTS 15 46 0 1700
206420906 aniket_kundu H May 19, 2023, 8:21 a.m. OK GNU C++20 (64) TESTS 15 46 0 1700
206343297 Vistarin H May 18, 2023, 1:08 p.m. OK GNU C++20 (64) TESTS 15 46 0 1700
206208581 mikko_mikust H May 17, 2023, 12:18 p.m. OK GNU C++20 (64) TESTS 15 46 0 1700
205528751 ivan100sic H May 12, 2023, 11:25 a.m. OK GNU C++20 (64) TESTS 15 46 0 1700
206014430 kribri H May 15, 2023, 5:29 p.m. OK Java 11 TESTS 15 389 77004800 1700
206368125 js2585 H May 18, 2023, 5:02 p.m. OK Java 11 TESTS 15 748 193945600 1700
206457618 kocko H May 19, 2023, 2:32 p.m. OK Java 11 TESTS 15 1543 167321600 1700
206371420 rajashish914 H May 18, 2023, 5:34 p.m. OK Java 17 TESTS 15 717 79155200 1700
205546694 magic_kid H May 12, 2023, 2:17 p.m. OK Java 8 TESTS 15 342 81203200 1700
206272684 nomadicjuggrnaut H May 17, 2023, 6:26 p.m. OK Java 8 TESTS 15 358 0 1700
205720227 Saurabh-Sharma H May 13, 2023, 12:55 p.m. OK Java 8 TESTS 15 577 148889600 1700
205635748 niks_vat H May 12, 2023, 6:40 p.m. OK Java 8 TESTS 15 592 160563200 1700
205529598 SlavaG H May 12, 2023, 11:34 a.m. OK Kotlin 1.7 TESTS 15 1138 200601600 1700
205751718 mariibykova H May 13, 2023, 6:04 p.m. OK PyPy 3 TESTS 15 436 14438400 1700
205711711 lamnguyen2187 H May 13, 2023, 11:35 a.m. OK PyPy 3 TESTS 15 561 70860800 1700
206067822 2000030996-akanksha H May 16, 2023, 9:26 a.m. OK PyPy 3 TESTS 15 639 72294400 1700
206072376 AyuAnchor H May 16, 2023, 10:14 a.m. OK PyPy 3-64 TESTS 15 202 19968000 1700
206374053 gdialex H May 18, 2023, 6:01 p.m. OK PyPy 3-64 TESTS 15 358 16588800 1700
206019056 Probability1 H May 15, 2023, 6:21 p.m. OK PyPy 3-64 TESTS 15 374 19660800 1700
206172622 shiviDON H May 17, 2023, 5:24 a.m. OK PyPy 3-64 TESTS 15 436 112537600 1700
205944347 Febrin H May 15, 2023, 5:37 a.m. OK PyPy 3-64 TESTS 15 561 133324800 1700
206372994 SEREGA1506 H May 18, 2023, 5:50 p.m. OK PyPy 3-64 TESTS 15 592 16896000 1700
206407098 Shri_874 H May 19, 2023, 5:40 a.m. OK PyPy 3-64 TESTS 15 608 136908800 1700
206360254 Sam_Jiang H May 18, 2023, 3:41 p.m. OK PyPy 3-64 TESTS 15 685 28979200 1700
205724773 drugkeeper H May 13, 2023, 1:37 p.m. OK PyPy 3-64 TESTS 15 702 131276800 1700
205944979 Karthik1106 H May 15, 2023, 5:47 a.m. OK PyPy 3-64 TESTS 15 764 150425600 1700
205991023 nutsjamie H May 15, 2023, 1:37 p.m. OK Python 3 TESTS 15 873 18841600 1700

remove filters

Back to search problems