I am not able to understand the O(n^3) implementation given in editorial to this - https://codeforces.com/contest/1027/problem/E problem. Editorial is somewhat clear but implementation is not.
Doubt in cf problem
Hey @yuvi2701 see this one
https://programmersought.com/article/80751806761/
It might help you as explanation given by them is quite brief 
Sorry but still not clear.
Can you please elaborate what a_i, b_i, d[x], c[x] and dp[i][j] are storing?
dp[i][j] is storing the longest continuous number less than j of length i
Try with this editorial https://www.programmersought.com/article/74322462320/
What is this line doing-
for(int i=n;i>=1;i–)dp[n][i]=(dp[n][i]-dp[n][i-1]+Mod)%Mod;
It’s taking color of the new tile which is as same as the previous one by calculating dp[n][i-1] for dp[n][i]
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.