Now I get it, I was misinterpreting question all this time. Actually after finish of each round, lead is not the difference between points of that round. But the lead is difference between the points achieved through all rounds including current round - Lakpa Tashi Bhutia
What should be a good learning source and procedure for learning C++ for the preparation of ZCO?
I have some knowledge of c++, know python and a pinch of Java. We are being taught c++ in our school, but I don't have much knowledge on some topics like vector, std::array, std::map,etc. Any help will be appreciated.
I am mother of 6th Std Child . I am aware of lots of training institutes which impart C++ or any other language training . However is there any training institute which prepares child for ZCO ? How to go about its preparation ? Kindly Help.
I made a DP state similar to LCS where dp[i][j] indicates the length of the best subsequence possible using A[0..j] and B[0..j]. Then for each state I select an element from A[0..j-1] and try to find its complement in B using a map. See the code for more detail.
However this fails on all test cases except two giving me a depressing 20/100.
What is wrong with my DP? What other approaches are possible? This approach (if you assume all elements in B are distinct) becomes O(N^3 log N). If we don't assume all elements are distinct, we get ~= the same time (I guess?). I did not get any TLEs on the judge, and the worst time was 0.103s so that's a good sign.
1.In Keshav's Repo here, L[i][j] is used to represent the no. of connections to previous subsequences with same differences(same differences between respective pairs) till i in the the first array and j in the second array.
2. The if condition in line 31 actually comes from line 32. This is a big hint.