Hi!

In the new video, we’re going to talk about the amazing data structure called Segment Tree Beats, which allows us to support a huge number of operations that a regular segment tree can’t handle. We will learn how to take numbers on a segment modulo some number, apply the min= and max= operations, add += to them, and also find GCD on a segment with these operations. And all the proofs are gonna be super simple, so don’t be scared, it will be easy! In the next video, we will cover even more awesome queries, so stay tuned.

You can check out my previous videos on my channel

Contest on Segment Tree Beats (and others) is here

Also, there's the Russian version of this video if you speak Russian here

Implementations of algorithms from this video:

%= on a segment, = in a point, sum on a segment

Ji Driver Segment Tree (min= on a segment, sum on a segment)

Everything from the previous implementation but also GCD on a segment of algorithms from this video:

%= on a segment, = in a point, sum on a segment

Ji Driver Segment Tree (min= on a segment, sum on a segment)

Everything from the previous realisation but also GCD on a segment

Wow man this is real content, and by that I mean not just like repetitive topics being repeated by almost every new YouTuber which makes it confusing at times.

Thanks! I try to bring something new. But different perspectives on well-known ideas are also important in my opinion. I often watch videos on topics I know well and pretty much always find there something fresh for me.

This went over my head. Please make some lectures for guys with rating range 1600-1900. Thanks. By the way, you explain very well, I have watched your previous videos.

Dude there are 998244353 resources for people in that rating range already, while there are almost none for IMs and above. Please stop hijacking threads.

In the past 7 hours, it increased by $$$1757654$$$. The number for IMs hasn't increased.

why this part is omitted in the english version of this post lol

Segment Tree Beats is the English name and the second one is the Russian version of it.

Let's call it Weeb Segment Tree in English. At least this name gives us some information about the author, while the word "beats" it just useless.

Ok downvoters, keep on living with shitty naming

The video is well-prepared and the explanation is crystal-clear, bravo!

Thanks! It means the world to me.

The video is so nice and easy to understand!

You're a great video maker, for sure.

As far as I can remember, I have recently seen a video about Farah-Colton and Bender algorithm on you channel and now I can't find it. Am I mistaken or just can't find it or is it deleted now?

Notice that $$$= x$$$ on seg $$$\Leftrightarrow$$$ combination of $$$min= \ x $$$ and $$$max= \ x$$$ on seg. This makes implementation easier.

I have two very similar codes(first, second). The only difference is that in the first code there is a restriction $$$l==r$$$ in tag condition. It gets AC, but if I remove that extra restriction, it gets WA9(second submission).

Any idea why that happens?

because if you stop when l != r, you need to have push values and lazy propagate them later

Oof, I missed that. Thanks!

In E, why in doPushSum do we have to check if min==max for a node? Why can't we just add as we do if min!=max? What changes?

Sorry for pinging peltorator, but I don't understand it :)

Are you talking about my solution? IDK, maybe we shouldn't. But this case where all the numbers are equal is just tricky so I checked it everywhere to be sure.

I couldn't get AC without that part btw. Thanks for the answer!