PROSORT 2019 Problem D Help!

Can anyone please explain the approach to the problem:
https://www.codechef.com/PROS2019/problems/STOYS/

This problem is JOI 2016 skyscraper. Zscoder has provided a detailed explanation here (it’s under connected component DP).

1 Like