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 . :)
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 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 . :)
Название |
---|
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 ?