Hello,I was trying this question and thought to use Dynamic programming but it will exceed memory limit.Can anybody give me a sight how to solve this question.
Hello,I was trying this question and thought to use Dynamic programming but it will exceed memory limit.Can anybody give me a sight how to solve this question.
This Problem was on previous contests. You can find the Editorial here.