Bitwise Operations for Competitive Programming | Topic Stream 8

Поділитися
Вставка
  • Опубліковано 5 чер 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
  • Наука та технологія

КОМЕНТАРІ • 47

  • @kushaagra098
    @kushaagra098 2 роки тому +55

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

    • @ColinGalen
      @ColinGalen  2 роки тому +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 2 роки тому

      @@ColinGalenWHere's the voting was done ?

    • @ColinGalen
      @ColinGalen  2 роки тому +1

      @@336_saranyamaity8 It was done at ua-cam.com/video/eFlR4ymrKGI/v-deo.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 2 роки тому +1

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

  • @supersaiyan-goku-san
    @supersaiyan-goku-san 2 роки тому +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 2 роки тому +1

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

  • @godspeed5550
    @godspeed5550 2 роки тому +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  2 роки тому +5

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

  • @joshua_dlima
    @joshua_dlima 2 роки тому

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

  • @rdxrdx1792
    @rdxrdx1792 7 місяців тому

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

  • @saptarshishome4409
    @saptarshishome4409 2 роки тому +11

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

    • @harshdhawale2669
      @harshdhawale2669 Рік тому

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

    • @yashjoshi
      @yashjoshi 6 місяців тому

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

  • @justjie1008
    @justjie1008 2 роки тому +1

    Damn your explanations are godly.

  • @Mani_OnFire
    @Mani_OnFire 2 роки тому +1

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

  • @josephwong2832
    @josephwong2832 2 роки тому

    you're an awesome teacher

  • @shashanksingh4708
    @shashanksingh4708 2 роки тому +1

    Thanks alot this is great 👍

  • @akshat2806
    @akshat2806 2 роки тому +2

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

    • @ColinGalen
      @ColinGalen  2 роки тому +2

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

    • @akshat2806
      @akshat2806 2 роки тому +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

  • @Miyano_Shiho4869
    @Miyano_Shiho4869 Рік тому

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

  • @nirajandata
    @nirajandata 2 роки тому

    thanks mr. colin

  • @shahinsiddiquei4513
    @shahinsiddiquei4513 2 роки тому +1

    AWESOME!!!

  • @abdullasulfikkar5282
    @abdullasulfikkar5282 2 роки тому

    Thank you :)

  • @coefficient1359
    @coefficient1359 2 роки тому

    Thank you

  • @georgedrooj8800
    @georgedrooj8800 2 роки тому

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

  • @rishisharma0930
    @rishisharma0930 8 місяців тому

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

  • @rajkaransingh8305
    @rajkaransingh8305 Рік тому

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

  • @adinonymous640
    @adinonymous640 2 роки тому

    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?

  • @132abhishekanantsingh4
    @132abhishekanantsingh4 2 роки тому

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

  • @williamwambua7710
    @williamwambua7710 2 роки тому

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

  • @PepeTostado
    @PepeTostado 2 роки тому

    When would you use bit wise operations

  • @ng3w462
    @ng3w462 2 роки тому

    Op bro 🤟🤟

  • @garvittiwari11a61
    @garvittiwari11a61 2 роки тому +1

    Graphs next please 😀

  • @yashjoshi
    @yashjoshi 6 місяців тому

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

  • @user-qt7hc9ti3o
    @user-qt7hc9ti3o Місяць тому

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

  • @ScepticalKannadiga
    @ScepticalKannadiga 2 роки тому

    🔥🔥

  • @vishalchoubey5606
    @vishalchoubey5606 2 роки тому

    Binary strings next ෆ╹ .̮ ╹ෆ

  • @solaris413
    @solaris413 2 роки тому +8

    next please Combinatorics 1700+

    • @ColinGalen
      @ColinGalen  2 роки тому +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: ua-cam.com/video/le2enQgQ7Ws/v-deo.html

  • @dangduong5362
    @dangduong5362 2 роки тому

    orz

  • @sobieso
    @sobieso 2 роки тому +2

    colin

  • @dioc7856
    @dioc7856 Рік тому

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

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 2 роки тому +2

    LinkedList please!