Блог пользователя Wax

Автор Wax, история, 16 месяцев назад, По-английски

I am suffering from bitwise trauma! I can solve same rating other problems but on same rating bitmask problem,I got stuck in it,....

  • Проголосовать: нравится
  • -7
  • Проголосовать: не нравится

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Solve problems from Codeforces with difficulty ratings between 900 and 1500 that are tagged with bitmasks. For each problem, visualize the logic using bit-level representations. Focus on helping understand how bit manipulation or bitmasking is used in the solution.

»
16 месяцев назад, скрыть # |
 
Проголосовать: нравится +5 Проголосовать: не нравится

I would suggest you to watch some videos on bitwise operators and learning about a few identities. Also, learn how to manipulate kth bit of a number. Also, when faced with certain bitmasks (at unrated level), try this thing, first try to solve it for a binary string instead of an actual array of numbers. Then just repeat the solution for 32 (or 64) binary strings combining to form the numbers.