Тёмный

Bitwise Operations for Competitive Programming | Topic Stream 8 

Colin Galen
Подписаться 237 тыс.
Просмотров 28 тыс.
50% 1

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

Наука

Опубликовано:

 

10 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 47   
@kushaagra098
@kushaagra098 2 года назад
This is actually amazing! Can you do number theory next? I am really looking forward to it!!!
@ColinGalen
@ColinGalen 2 года назад
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 года назад
@@336_saranyamaity8 It was done at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eFlR4ymrKGI.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 года назад
@@ColinGalen thanks , and after commenting in most of your videos you finally replied sensei ✌️
@mukulkadyan7403
@mukulkadyan7403 2 года назад
Started following u after those precious topic streams and they are back now 😍😍Thanks alot @Colin
@supersaiyan-goku-san
@supersaiyan-goku-san 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!
@saptarshishome4409
@saptarshishome4409 2 года назад
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)
@joshua_dlima
@joshua_dlima 2 года назад
Amazing vid bro!!! one of the best vids on bit manipulation out there! tysm!!
@godspeed5550
@godspeed5550 2 года назад
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 года назад
xor basis is mid-range? yikes, i'm behind edit: a serious reply, yes, if it wins a vote
@rdxrdx1792
@rdxrdx1792 7 месяцев назад
I don't know whether you are still active, but after 2 years it still helped me
@justjie1008
@justjie1008 2 года назад
Damn your explanations are godly.
@Mani_OnFire
@Mani_OnFire 2 года назад
Thank you so much bro, very very very useful, I'm very happy, I'm very thankful very much, peace ✌️
@akshat2806
@akshat2806 2 года назад
These are just incredible plz keep doing some complex topics like types of dp, segtree
@ColinGalen
@ColinGalen 2 года назад
FYI, I've done a dp + segtree stream, can be found at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KX_-7AqcnEU.html
@akshat2806
@akshat2806 2 года назад
@@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
@josephwong2832
@josephwong2832 2 года назад
you're an awesome teacher
@shashanksingh4708
@shashanksingh4708 2 года назад
Thanks alot this is great 👍
@nirajandata
@nirajandata 2 года назад
thanks mr. colin
@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?
@shahinsiddiquei4513
@shahinsiddiquei4513 2 года назад
AWESOME!!!
@rishisharma0930
@rishisharma0930 8 месяцев назад
Bits are independent....Wow, it made approaching problems easier
@coefficient1359
@coefficient1359 2 года назад
Thank you
@georgedrooj8800
@georgedrooj8800 2 года назад
How many days do we have to solve the mashup ?? To stick with your plan
@abdullasulfikkar5282
@abdullasulfikkar5282 2 года назад
Thank you :)
@rajkaransingh8305
@rajkaransingh8305 Год назад
Can you shed light on monotonic nature of AND and OR or share some resources regarding this
@132abhishekanantsingh4
@132abhishekanantsingh4 2 года назад
btw what's the time complexity of _popcount , _clz and _ctz
@PepeTostado
@PepeTostado 2 года назад
When would you use bit wise operations
@user-qt7hc9ti3o
@user-qt7hc9ti3o Месяц назад
here you said 3^n but there are many duplicates so what is the correct answer??????????????????
@ng3w462
@ng3w462 2 года назад
Op bro 🤟🤟
@williamwambua7710
@williamwambua7710 2 года назад
Would actually appreciate if we picked couple problems and we implement them...Thank you
@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)
@ScepticalKannadiga
@ScepticalKannadiga 2 года назад
🔥🔥
@garvittiwari11a61
@garvittiwari11a61 2 года назад
Graphs next please 😀
@vishalchoubey5606
@vishalchoubey5606 2 года назад
Binary strings next ෆ╹ .̮ ╹ෆ
@solaris413
@solaris413 2 года назад
next please Combinatorics 1700+
@ColinGalen
@ColinGalen 2 года назад
I'm fine with repeating stuff, but in case you (or anyone reading) didn't know, I've already done a stream on this: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-le2enQgQ7Ws.html
@dangduong5362
@dangduong5362 2 года назад
orz
@sobieso
@sobieso 2 года назад
colin
@leetcoder1159
@leetcoder1159 2 года назад
Yes dear
@ChandraShekhar-by3cd
@ChandraShekhar-by3cd 2 года назад
LinkedList please!
@anshuman5554
@anshuman5554 2 года назад
that's not cp
@dioc7856
@dioc7856 Год назад
Not my point to cpmplain but wathcing this viedo made me watch also 20+ ads wtf
Далее
C++ Mistakes Noobs Make (and how to prevent them)
28:22
Bitwise Operators and WHY we use them
8:41
Просмотров 60 тыс.
why do void* pointers even exist?
8:17
Просмотров 320 тыс.
Bitwise Operations & Bit Masking
13:08
Просмотров 32 тыс.