Back to Browse

Segment Tree with Lazy Propagation | 3 Codeforces EDU Problems Solved (Range Update + Queries)

306 views
Sep 17, 2025
28:19

In this video, we solve ๐ญ๐ก๐ซ๐ž๐ž ๐‚๐จ๐๐ž๐Ÿ๐จ๐ซ๐œ๐ž๐ฌ ๐„๐ƒ๐” ๐ฉ๐ซ๐จ๐›๐ฅ๐ž๐ฆ๐ฌ ๐ฎ๐ฌ๐ข๐ง๐  ๐’๐ž๐ ๐ฆ๐ž๐ง๐ญ ๐“๐ซ๐ž๐ž๐ฌ ๐ฐ๐ข๐ญ๐ก ๐‹๐š๐ณ๐ฒ ๐๐ซ๐จ๐ฉ๐š๐ ๐š๐ญ๐ข๐จ๐ง. This is the perfect follow-up if youโ€™ve already understood the concept and now want to sharpen your problem-solving skills.โฃ โฃ Weโ€™ll solve the following problems step by step with full explanation + code implementation:โฃ 1๏ธโƒฃ ๐€๐๐๐ข๐ญ๐ข๐จ๐ง ๐š๐ง๐ ๐Œ๐ข๐ง๐ข๐ฆ๐ฎ๐ฆ โ†’ Range add updates + Range minimum queryโฃ 2๏ธโƒฃ ๐€๐๐๐ข๐ญ๐ข๐จ๐ง ๐š๐ง๐ ๐’๐ฎ๐ฆ โ†’ Range add updates + Range sum queryโฃ 3๏ธโƒฃ ๐€๐ฌ๐ฌ๐ข๐ ๐ง๐ฆ๐ž๐ง๐ญ ๐š๐ง๐ ๐’๐ฎ๐ฆ โ†’ Range assignment updates + Range sum queryโฃ โฃ ๐–๐ก๐š๐ญ ๐ฒ๐จ๐ฎโ€™๐ฅ๐ฅ ๐ฅ๐ž๐š๐ซ๐ง ๐ข๐ง ๐ญ๐ก๐ข๐ฌ ๐ฏ๐ข๐๐ž๐จ:โฃ โœ… How to apply ๐ฅ๐š๐ณ๐ฒ ๐ฉ๐ซ๐จ๐ฉ๐š๐ ๐š๐ญ๐ข๐จ๐ง ๐ข๐ง ๐ซ๐ž๐š๐ฅ ๐œ๐จ๐ฆ๐ฉ๐ž๐ญ๐ข๐ญ๐ข๐ฏ๐ž ๐ฉ๐ซ๐จ๐ ๐ซ๐š๐ฆ๐ฆ๐ข๐ง๐  ๐ฉ๐ซ๐จ๐›๐ฅ๐ž๐ฆ๐ฌโฃ โœ… How to modify ๐ฌ๐ž๐ ๐ฆ๐ž๐ง๐ญ ๐ญ๐ซ๐ž๐ž๐ฌ ๐Ÿ๐จ๐ซ ๐ฆ๐ข๐ง๐ข๐ฆ๐ฎ๐ฆ, ๐ฌ๐ฎ๐ฆ, ๐š๐ง๐ ๐š๐ฌ๐ฌ๐ข๐ ๐ง๐ฆ๐ž๐ง๐ญ ๐ช๐ฎ๐ž๐ซ๐ข๐ž๐ฌโฃ โœ… Full code walkthrough in C++ (logic can be applied in Python/Java too)โฃ โœ… Dry runs + Intuition to make sure you fully understand the solutionโฃ โฃ This session is designed to build mastery over segment trees with lazy propagation and prepare you for ๐‚๐จ๐๐ž๐Ÿ๐จ๐ซ๐œ๐ž๐ฌ, ๐‚๐’๐„๐’, ๐€๐ญ๐‚๐จ๐๐ž๐ซ, ๐š๐ง๐ ๐œ๐จ๐๐ข๐ง๐  ๐ข๐ง๐ญ๐ž๐ซ๐ฏ๐ข๐ž๐ฐ๐ฌ.โฃ โฃ ๐Ÿ‘‰ ๐๐ซ๐จ๐›๐ฅ๐ž๐ฆ ๐‹๐ข๐ง๐ค๐ฌ:โฃ 1. https://codeforces.com/edu/course/2/lesson/5/2/practice/contest/279653/problem/Aโฃ 2. https://codeforces.com/edu/course/2/lesson/5/2/practice/contest/279653/problem/Dโฃ 3. https://codeforces.com/edu/course/2/lesson/5/2/practice/contest/279653/problem/Fโฃ โฃโฃ ๐Ÿ”— ๐๐ฅ๐š๐ฒ๐ฅ๐ข๐ฌ๐ญ: https://youtube.com/playlist?list=PLtfqa971vD5GTQjH9U0H6kiq9cQlFFa5k&si=YKuHrjhvmUlXoTBMโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ โฃโฃ ๐Ÿ“Œ Donโ€™t forget to check the previous videos if youโ€™re new to Segment Trees!โฃโฃ โฃโฃ ๐Ÿ’ก Perfect for:โฃโฃ - Competitive programmersโฃโฃ - Data structure & algorithms learnersโฃโฃ - Coding interview prepโฃโฃ โฃโฃ ๐Ÿ“Œ Watch this till the end to fully understand the intuition, not just the code.โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ‘‰ Whether you are a beginner or looking to strengthen your problem-solving skills, this course will help you ๐ญ๐ก๐ข๐ง๐ค ๐ฅ๐ข๐ค๐ž ๐š ๐œ๐จ๐ฆ๐ฉ๐ž๐ญ๐ข๐ญ๐ข๐ฏ๐ž ๐ฉ๐ซ๐จ๐ ๐ซ๐š๐ฆ๐ฆ๐ž๐ซ ๐š๐ง๐ ๐š๐ฉ๐ฉ๐ฅ๐ฒ ๐ฌ๐ž๐ ๐ฆ๐ž๐ง๐ญ ๐ญ๐ซ๐ž๐ž ๐œ๐จ๐ง๐Ÿ๐ข๐๐ž๐ง๐ญ๐ฅ๐ฒ ๐ข๐ง ๐œ๐จ๐ง๐ญ๐ž๐ฌ๐ญ๐ฌ.โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ‘‹ ๐–๐ž๐ฅ๐œ๐จ๐ฆ๐ž ๐ญ๐จ ๐ญ๐ก๐ž ๐œ๐ก๐š๐ง๐ง๐ž๐ฅ!โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ I create content on ๐‚๐จ๐ฆ๐ฉ๐ž๐ญ๐ข๐ญ๐ข๐ฏ๐ž ๐๐ซ๐จ๐ ๐ซ๐š๐ฆ๐ฆ๐ข๐ง๐ , ๐ƒ๐š๐ญ๐š ๐’๐ญ๐ซ๐ฎ๐œ๐ญ๐ฎ๐ซ๐ž๐ฌ & ๐€๐ฅ๐ ๐จ๐ซ๐ข๐ญ๐ก๐ฆ๐ฌ (๐ƒ๐’๐€), ๐š๐ง๐ ๐“๐ž๐œ๐ก๐ง๐ข๐œ๐š๐ฅ ๐ˆ๐ง๐ญ๐ž๐ซ๐ฏ๐ข๐ž๐ฐ ๐๐ซ๐ž๐ฉ๐š๐ซ๐š๐ญ๐ข๐จ๐ง.โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ If you find this video helpful, donโ€™t forget to:โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ‘ Like the videoโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ’ฌ Comment your doubts/questions (I reply to everyone!)โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ”” Subscribe and turn on notifications to never miss upcoming tutorialsโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ“Œ Connect with me:โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿฆ X: https://x.com/Yash_Poonia_โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ’ผ LinkedIn: https://www.linkedin.com/in/yashpoonia/โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐Ÿ’ป GitHub: https://github.com/yash7xmโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ ๐ŸŒ Discord: https://discord.gg/cYeENy6Cโฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ โฃโฃโฃโฃโฃโฃโฃโฃโฃโฃ #SegmentTree #LazyPropagation #CompetitiveProgramming #Codeforces #DSA #RangeQueries #CodingInterview

Download

0 formats

No download links available.

Segment Tree with Lazy Propagation | 3 Codeforces EDU Problems Solved (Range Update + Queries) | NatokHD