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 | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
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 ?