This problem would have been a classical problem if the memory limits would not have been that tight. In the classical version we can use DP or the LCS with O(n^2) memory but this problem requires O(n) memory.
How to go about it?
I searched the solution of this problem online but found only codes and not the solution.
Hey, I am new in programming. I don't know much about it. That's why I am seeking for help here. I confused which language should start learing first . And also needed suggestion for which books I should follow.
Q&A session with Mahbubul Hasan, Codeforces Bangladesh #1by Keshav Dhandhania
Hello everyone! I am Md Mahbubul Hasan from Bangladesh. I entered competitive programming world probably back in 2003 when I was in class 10. Unfortunately tutorials, editorials etc was not much available back then. Even there was not much of online competitions, except some regular monthly or bi-weekly contest at UVa, specially during the end of a year. It was difficult to access TopCoder from our country, even in 2005, because of slow internet and load shedding issues. We went to ACM ICPC World Finals in 2008 and 2009. Since then I am no longer devoted in programming contest as full time. But somehow I managed to float around in the same level through out the time. It was wonderful to compete with/against multi generation of contestants from our country. Nowadays I mostly take part in annual competitions where there is tshirt as prize. Even if it is not by performance, my luck does not disappoint me winning them in lottery!
Personally I have very low capacity hard disk (can't recognize people, can't recall names, even if you give me some problem which I solved a few days ago there is high probability that I would...
Q&A session with Amr Mahmoud, Codeforces Egypt #1by Keshav Dhandhania
My name is Amr Mahmoud. I'm currently studying Computer and Systems Engineering at Alexandria University. I was on the team that got the first place in Egypt National CPC, also the first place in Arab Regional CPC, and qualified to last year's ICPC in Phuket. I had an internship in Microsoft R&D lab. I'm currently doing an internship in Amazon web services.