Increasing Subsequence II (CSES) | Segment Tree + Coordinate Compression (Hard DP)
Welcome back to the ๐๐๐ ๐ฆ๐๐ง๐ญ ๐๐ซ๐๐ ๐๐๐ซ๐ข๐๐ฌ ๐โฃโฃ โฃโฃ In this video, we solve the CSES Problem โ ๐๐ง๐๐ซ๐๐๐ฌ๐ข๐ง๐ ๐๐ฎ๐๐ฌ๐๐ช๐ฎ๐๐ง๐๐ ๐๐ ๐ฎ๐ฌ๐ข๐ง๐ ๐๐๐ ๐ฆ๐๐ง๐ญ ๐๐ซ๐๐ + ๐๐จ๐จ๐ซ๐๐ข๐ง๐๐ญ๐ ๐๐จ๐ฆ๐ฉ๐ซ๐๐ฌ๐ฌ๐ข๐จ๐ง.โฃโฃ โฃโฃ This is an ๐๐๐ฏ๐๐ง๐๐๐ ๐๐ฒ๐ง๐๐ฆ๐ข๐ ๐๐ซ๐จ๐ ๐ซ๐๐ฆ๐ฆ๐ข๐ง๐ ๐ฐ๐ข๐ญ๐ก ๐๐๐ญ๐ ๐๐ญ๐ซ๐ฎ๐๐ญ๐ฎ๐ซ๐๐ฌ ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ, where we count the number of increasing subsequences in an array, modulo 1e9+7.โฃโฃ โฃโฃ ๐๐ ๐๐จ๐ฏ๐๐ซ ๐๐ฏ๐๐ซ๐ฒ๐ญ๐ก๐ข๐ง๐ ๐ฌ๐ญ๐๐ฉ ๐๐ฒ ๐ฌ๐ญ๐๐ฉ:โฃโฃ - Understanding the problem statement ๐โฃโฃ - Brute force approach and why it fails โโฃโฃ - Using ๐๐ + ๐๐๐ ๐ฆ๐๐ง๐ญ ๐๐ซ๐๐ to efficiently calculate subsequences โกโฃโฃ - ๐๐จ๐จ๐ซ๐๐ข๐ง๐๐ญ๐ ๐๐จ๐ฆ๐ฉ๐ซ๐๐ฌ๐ฌ๐ข๐จ๐ง to handle large values (up to 1e9)โฃโฃ โฃโฃ Full C++ implementation with detailed explanationโฃโฃ โฃโฃ ๐ก ๐๐ฒ ๐ญ๐ก๐ ๐๐ง๐ ๐จ๐ ๐ญ๐ก๐ข๐ฌ ๐ฏ๐ข๐๐๐จ, ๐ฒ๐จ๐ฎ ๐ฐ๐ข๐ฅ๐ฅ:โฃโฃ - Master how to use ๐๐๐ ๐ฆ๐๐ง๐ญ ๐๐ซ๐๐๐ฌ ๐๐จ๐ซ ๐๐จ๐ฎ๐ง๐ญ๐ข๐ง๐ ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ๐ฌโฃโฃ - Understand ๐๐จ๐จ๐ซ๐๐ข๐ง๐๐ญ๐ ๐๐จ๐ฆ๐ฉ๐ซ๐๐ฌ๐ฌ๐ข๐จ๐ง clearlyโฃโฃ - Be ready to solve other ๐๐๐ฏ๐๐ง๐๐๐ ๐๐ + ๐๐๐ ๐ฆ๐๐ง๐ญ ๐๐ซ๐๐ problems in contestsโฃโฃ โฃโฃ ๐ ๐๐ซ๐จ๐๐ฅ๐๐ฆ ๐๐ข๐ง๐ค: โฃโฃโฃ https://cses.fi/problemset/task/1748/โฃโฃ โฃโฃโฃ ๐ฅ ๐๐ฅ๐๐ฒ๐ฅ๐ข๐ฌ๐ญ ๐๐ข๐ง๐ค: https://youtube.com/playlist?list=PLtfqa971vD5GTQjH9U0H6kiq9cQlFFa5k&si=tpC7IxUtmfO49W--โฃโฃโฃโฃ โฃโฃโฃโฃ ๐ ๐๐ญ๐๐ฒ ๐ญ๐ฎ๐ง๐๐, ๐ฌ๐ฎ๐๐ฌ๐๐ซ๐ข๐๐, ๐๐ง๐ ๐๐จ๐ฅ๐ฅ๐จ๐ฐ ๐ญ๐ก๐ ๐ฉ๐ฅ๐๐ฒ๐ฅ๐ข๐ฌ๐ญ to not miss the advanced problems!โฃโฃโฃโฃ โฃโฃโฃ ๐ Donโt forget to ๐ฅ๐ข๐ค๐, ๐ฌ๐ก๐๐ซ๐, ๐๐ง๐ ๐ฌ๐ฎ๐๐ฌ๐๐ซ๐ข๐๐ if you find this helpful!โฃโฃโฃ โฃโฃ #SegmentTree #CSES #CompetitiveProgramming #DynamicProgramming #DataStructures #CodingInterview #Codeforces #Programming
Download
0 formatsNo download links available.