Been stuck on this for a long time. Can’t figure out whats wrong:
This is how I solved the problem.
I solved this 2-months ago while practicing dp:-
Now, using its concepts CIMERGE can be solved.
Thanks! I’ll try this…
But I really suck at dp, always end up looking at the editorial… any tips? How do you approach dp?
You just have to change INT_MAX to some large value. INT_MAX has value of 2147483647 but the larger testcases may exceed this.
Tried it: https://www.codechef.com/viewsolution/25350258
There is another INT_MAX inside the f function.
THANKS!!! It Worked!