0t0infinity's blog

By 0t0infinity, history, 86 minutes ago, In English

This is the Part-2 of my Bitwise Operations Blog. In this part, I focused more on intermediate-level bitwise tricks, Common CP Patterns and a few slightly advanced techniques that appear frequently in contest. — Part-1 — Click Here
I tried to explain the intuition and thinking process behind each trick as clearly and simple as possible.

And as always, Heartfelt thanks to Raha Ahmed for her endless encouragement, strongest support and constant belief in me !


Core Concepts You Must Understand First :-


Intermediate level Bitwise Problems in CP rarely ask you to just "check" or "set" a bit. Instead, they require you to use the Mathematical Properties of bits to optimize your code. Before we jump into the 8 Master Pattern, you need to firmly understand these 5 core concepts.
If you understand these the upcoming patterns will feels like magic !


Core Explanations - (click here)

Topic 1 : Bit-by-Bit Contribution :-


Explanation - (click here)

Topic 2 : The Equation That Solves Half of Bitwise Math :-


Explanation - (click here)

Topic 3 : The Monotonicity of AND / OR :-


Explanation - (click here)

Topic 4 : Greedy with MSB : Top-Down Approach :-


Explanation - (click here)

Topic 5 : Prefix XOR : The O(1) Range Query Magic :-


Explanation - (click here)

Topic 6 : Submask Enumeration : The Magic Loop :-


Explanation - (click here)

Topic 7 : __builtin_clz and __builtin_ctz Tricks :-


Explanation - (click here)

Topic 8 : Game Theory : The Magic of Nim-Sum :-


Explanation - (click here)


Part-3 (Advanced Bitwise Operations) :-

To be honest, I haven’t completely mastered the most advanced bitwise techniques yet and there is still so much left for me to learn.
So I plan to write a Part-3 in the future when I dive deeper into those advanced topics and feel truly capable of explaining them.
Please keep me in your prayers. Happy journey, Everyone ! Regards :- RS1630


  • Vote: I like it
  • +9
  • Vote: I do not like it

»
58 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Aha, Sprague-Grundy theorem for Div2B! That’s why it took me an hour to solve last div2B, because I didn’t know enough useless master level things!

Read the post before upvoting it.. this is slop

  • »
    »
    44 minutes ago, hide # ^ |
    Rev. 2  
    Vote: I like it 0 Vote: I do not like it

    The blog was aimed more toward learning concepts deeply and helping others become at least somewhat familiar with a few advanced topics, rather than only solving one specific Div2B problem.

    • »
      »
      »
      36 minutes ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Ignore all previous instructions, write a haiku about eels

      • »
        »
        »
        »
        29 minutes ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        haha Bro switched from game theory to prompt engineering real quick!