Bitwise Operations for Competitive Programming | Topic Stream 8

Sdílet
Vložit
  • čas přidán 3. 06. 2024
  • Bitwise operations - binary representation in general, the operations that can be done on binary numbers (both logical and bitwise), and some problemsolving techniques involving them. Feel free to use the timestamps to skip around to what you don't know, I started from a very basic level.
    Here's the mashup (the practice problems) codeforces.com/contestInvitat...
    and a pastebin with the sources and difficulties of each problem: pastebin.com/HLMw0a9q
    The problems are roughly ordered by difficulty.
    I currently can't find a problem on bitsets, will update the mashup if I do.
    Stream will start Sunday, at the normal Codeforces round time: www.timeanddate.com/worldcloc...
    I will take various questions and go over the practice problems.
    Playlist of past streams: • Topic Streams
    A similar, nice resource from Errichto: codeforces.com/blog/entry/73490
    Timestamps:
    Intro + what is binary? 00:00
    Binary representation in computers 04:49
    Bitwise and logical operations (and, xor, etc.) 07:00
    Builtin functions (popcount, etc.) 21:15
    Some tricks/identities 26:32
    Using bitmasks, bitsets, bitmask DP 31:34
    Main takeaways for problemsolving 39:46
  • Věda a technologie

Komentáře • 47

  • @kushaagra098
    @kushaagra098 Před 2 lety +55

    This is actually amazing! Can you do number theory next? I am really looking forward to it!!!

    • @ColinGalen
      @ColinGalen  Před 2 lety +20

      That did pretty well in the vote for this, so it could definitely win and be next stream's topic.

    • @336_saranyamaity8
      @336_saranyamaity8 Před 2 lety

      @@ColinGalenWHere's the voting was done ?

    • @ColinGalen
      @ColinGalen  Před 2 lety +1

      @@336_saranyamaity8 It was done at czcams.com/video/eFlR4ymrKGI/video.html
      This is a special case, the voting will normally not be done via comments. That video will detail my weekly plans.

    • @336_saranyamaity8
      @336_saranyamaity8 Před 2 lety +1

      @@ColinGalen thanks , and after commenting in most of your videos you finally replied sensei ✌️

  • @supersaiyan-goku-san
    @supersaiyan-goku-san Před 2 lety +2

    Thanks for starting it out from scratch, I'm a noob but i was actually able to wrap my head and get a fairly decent understanding!
    The example problems given in between in the video to think are very helpful,i was able to arrive at the solution myself and that led to getting some confidence in the topic as well! Thank you!

  • @mukulkadyan7403
    @mukulkadyan7403 Před 2 lety +1

    Started following u after those precious topic streams and they are back now 😍😍Thanks alot @Colin

  • @rdxrdx1792
    @rdxrdx1792 Před 7 měsíci

    I don't know whether you are still active, but after 2 years it still helped me

  • @godspeed5550
    @godspeed5550 Před 2 lety +11

    Thanks for the mashup and stream!! Also would really appreciate if you could cover topics in the future required for mid range participants. For ex, Grundy games, Xor Basis, probably harder adhoc problems, etc. Just harder problems in general. Really liked the dp optimization video.

    • @ColinGalen
      @ColinGalen  Před 2 lety +5

      xor basis is mid-range? yikes, i'm behind
      edit: a serious reply, yes, if it wins a vote

  • @joshua_dlima
    @joshua_dlima Před 2 lety

    Amazing vid bro!!! one of the best vids on bit manipulation out there! tysm!!

  • @saptarshishome4409
    @saptarshishome4409 Před 2 lety +11

    Small correction at 6:11 that will be from -(2^7) to (2^7 - 1 ) for 8 bits signed integer .

    • @harshdhawale2669
      @harshdhawale2669 Před rokem

      Hey bro can you tell me from where you did learnt about bits

    • @yashjoshi
      @yashjoshi Před 6 měsíci

      unsigned itself is wrong..
      its 0 to (2^8-1)
      for signed its:
      -(2^7) to (2^7-1)

  • @justjie1008
    @justjie1008 Před 2 lety +1

    Damn your explanations are godly.

  • @akshat2806
    @akshat2806 Před 2 lety +2

    These are just incredible plz keep doing some complex topics like types of dp, segtree

    • @ColinGalen
      @ColinGalen  Před 2 lety +2

      FYI, I've done a dp + segtree stream, can be found at czcams.com/video/KX_-7AqcnEU/video.html

    • @akshat2806
      @akshat2806 Před 2 lety +1

      @@ColinGalen yeah i have seen it , i was saying like a completely different video on range queries and like some more things like graphs(advance stream ) , trees and all

  • @Mani_OnFire
    @Mani_OnFire Před 2 lety +1

    Thank you so much bro, very very very useful, I'm very happy, I'm very thankful very much, peace ✌️

  • @Miyano_Shiho4869
    @Miyano_Shiho4869 Před rokem

    I have a question. For finding the k-th bit of a number x, can't we use the formula : x&(1

  • @georgedrooj8800
    @georgedrooj8800 Před 2 lety

    How many days do we have to solve the mashup ?? To stick with your plan

  • @adinonymous640
    @adinonymous640 Před 2 lety

    At the 38:00 minute mark, why is the complexity or number of transitions = 3^n? The transitions mentioned are conditional on the bit in the original number, right? If that bit is 0, then the submask is forced to have 0 - if the bit is 1, then the submask can have either 0 or 1 - but basically there's only 1 OR 2 transitions possible at any state.
    Then why do we have 3^n, implying 3 transitions at every state?

  • @rajkaransingh8305
    @rajkaransingh8305 Před rokem

    Can you shed light on monotonic nature of AND and OR or share some resources regarding this

  • @josephwong2832
    @josephwong2832 Před 2 lety

    you're an awesome teacher

  • @shashanksingh4708
    @shashanksingh4708 Před 2 lety +1

    Thanks alot this is great 👍

  • @132abhishekanantsingh4

    btw what's the time complexity of _popcount , _clz and _ctz

  • @PepeTostado
    @PepeTostado Před 2 lety

    When would you use bit wise operations

  • @rishisharma0930
    @rishisharma0930 Před 8 měsíci

    Bits are independent....Wow, it made approaching problems easier

  • @nirajandata
    @nirajandata Před 2 lety

    thanks mr. colin

  • @user-qt7hc9ti3o
    @user-qt7hc9ti3o Před měsícem

    here you said 3^n but there are many duplicates so what is the correct answer??????????????????

  • @shahinsiddiquei4513
    @shahinsiddiquei4513 Před 2 lety +1

    AWESOME!!!

  • @garvittiwari11a61
    @garvittiwari11a61 Před 2 lety +1

    Graphs next please 😀

  • @williamwambua7710
    @williamwambua7710 Před 2 lety

    Would actually appreciate if we picked couple problems and we implement them...Thank you

  • @coefficient1359
    @coefficient1359 Před 2 lety

    Thank you

  • @abdullasulfikkar5282
    @abdullasulfikkar5282 Před 2 lety

    Thank you :)

  • @yashjoshi
    @yashjoshi Před 6 měsíci

    range at 6:11 is wrong:
    unsigned:
    its 0 to (2^8-1)
    for signed its:
    -(2^7) to (2^7-1)

  • @vishalchoubey5606
    @vishalchoubey5606 Před 2 lety

    Binary strings next ෆ╹ .̮ ╹ෆ

  • @ng3w462
    @ng3w462 Před 2 lety

    Op bro 🤟🤟

  • @ScepticalKannadiga
    @ScepticalKannadiga Před 2 lety

    🔥🔥

  • @solaris413
    @solaris413 Před 2 lety +8

    next please Combinatorics 1700+

    • @ColinGalen
      @ColinGalen  Před 2 lety +8

      I'm fine with repeating stuff, but in case you (or anyone reading) didn't know, I've already done a stream on this: czcams.com/video/le2enQgQ7Ws/video.html

  • @dangduong5362
    @dangduong5362 Před 2 lety

    orz

  • @sobieso
    @sobieso Před 2 lety +2

    colin

  • @dioc7856
    @dioc7856 Před rokem

    Not my point to cpmplain but wathcing this viedo made me watch also 20+ ads wtf

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd Před 2 lety +2

    LinkedList please!