div2 p1000
simple DP, recursion with memorization, dp[pos] is max score end at pos.
need to sort score from low to high.
caveat: score can be negative so need to use bool memo[60] to remember whether dp[pos] has been computed already. otherwise an easy 1000 problem.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment