These day im trying to improve my dp skills and then i faced this problem. I did come up with da solution and then... It bugged :(
First thought occured in mah mind was that if i was miswrite at some line... But i havent spotted it until now :|
Maybe i did not implement it in a correct algo? Or somehow mah eyes so dumb that i cant see the error... Thanks and appreciate all of your helps!
Mah submission: https://codeforces.net/contest/2022/submission/297780647 Btw this is my drawing about mah algo:
Auto comment: topic has been updated by Aureum (previous revision, new revision, compare).