needed help in problem Permutations from atcoder educational dp contest

Revision en1, by hars123, 2019-01-20 14:18:07

I have tried this problem a lot and also figured out the states. I am trying to build up a 2D dp table dp[i][j] where first i-1 signs are satisfied and last number in the sequence is j. can someone help me in finding out the transitions for these states and solve this problem in O(N^2). If someone could suggest a top-down approach it would be really helpful as i generally find it difficult to find transitions using bottom-up approach.

Tags #dynamic-programming, atcoder educational dp


  Rev. Lang. By When Δ Comment
en1 English hars123 2019-01-20 14:18:07 514 Initial revision (published)