I've put in a lot of my efforts this time, kept the video detailed so that a lot of people including beginners are able to understand how to solve this tough squareroot decomposition problem HILLJUMPING from Codechef August 17 Long Challenge.
Check out the video editorial here.
Then I explain my approach till 14:50 after which code discussion begins.
has a solution to this, let me know!
That bucketing and binary-search for a prefix-maxed array are the golden gems.
@Deepesh Yes you are correct, this results in a contradiction and hence such a sequence is impossible that generates given kind of graph.
Bro...it would be a great help if you could tell me how to be good at competitive programming. I currently have the codechef rating of 1726. Thanks in advance .