Hello codeforces community , can you please suggest me some Bitmask beginner problems ? I am beginner at bitmask . Just Bitmask problems , not Bitmask Dp . Hope someone will suggest me . :)
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 151 |
Hello codeforces community , can you please suggest me some Bitmask beginner problems ? I am beginner at bitmask . Just Bitmask problems , not Bitmask Dp . Hope someone will suggest me . :)
Name |
---|
It is quiet difficult to find easy problems that require just the use of bitmasks.
Bitmasks are often used to represent states (that's why they are frequently used in DP problems)
First it's important to learn some basic operations with bitmasks
Bitmasks can be used to represent sets, if the ith bit is on, then the ith object is included in some set. You can do some set operations.
Once you understand how bitmasks work (and how to use them in your programming language), you can solve problems like this one:
Given an array A of at most 20 integers, you must count the number of subsequences from this array which have positive sum
Using bitmasks you can solve this problem in O(n2n), this is not neccessarily the best solution, but it's just an example
I wrote this problem some time ago.
This one doesn't require DP, but it's not that easy though.
You can take a look at Hackerrank too, they have lots of tutorial about some programming techniques, including the use of bitmasks.
Can you kindly explain how to solve the no. of subsequences with +ve sum ?