MENU

Fun & Interesting

Префиксные суммы, разностные массивы и сила полуинтервалов

peltorator 29,426 lượt xem 3 years ago
Video Not Working? Fix It Now

Codeforces contest:
https://codeforces.com/group/1rv4rhCsHp/contests

My implementations of algorithms from this video:
Finding 1D prefix sums:
https://pastebin.com/MjxG7y43

Struct-based prefix sums for finding sum on segments:
https://pastebin.com/062t332c

2 methods for finding 2D prefix sums:
https://pastebin.com/a09xCDGw
https://pastebin.com/Yezy0Lkb

Finding 1D difference array: https://pastebin.com/fXpwTRiK

Struct-based difference array for adding on segment: https://pastebin.com/fbmveX6Q


I want to thank Grant Sanderson (the author of the 3blue1brown youtube channel) for inspiration and the brilliant manim library, this video was made with:
https://github.com/3b1b/manim

https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw

the_algorithmic_eye's article:
https://codeforces.com/blog/entry/86420

the_algorithmic_eye's youtube channel:
https://www.youtube.com/channel/UCvNmvZRPkkmkAtAF_mo53tw

Hi! My name is Egor. I study at Saint Petersburg State University in Russia. In this video, I'm talking about prefix sums and difference arrays. They are super simple but they can easily help in some sorts of situations where it seems like you need some complex data structures. I hope you find this video helpful. I'm gonna make more videos in the future. Both on basic algorithms such as binary search, sorting, etc., and also some advanced topics such as disjoint sparse table, segment tree beats, heavy-light decomposition, link-cut tree, lambda optimisation, FFT, and so on. If you're interested, consider subscribing to my channel! If you have any questions you can contact me on telegram. Good luck with your contests.

Reach me out on:
telegram:
https://t.me/peltorator

codeforces:
https://codeforces.com/profile/peltorator

instagram:
https://www.instagram.com/peltorator/

Or peltorator at any platform

Comment