I was trying to solve INOI 2019 Problem 2 - Interesting Sequences. I have tried the DP solution.
My approach -
1) Sort array and check for elements with same values and store the maximum answer possible.
2) LIS type DP to check the maximum answer.
3) Print the maximum of answers obtained from 1 and 2.
My approach is giving WA. I have tried to understand other's solutions and I have noticed they are something like binary search + DP. I cant understand it. Please help.
Here is the link to the problem - https://www.codechef.com/INOIPRAC/problems/INOI1902