hiddenanonymous's blog

By hiddenanonymous, history, 4 years ago, In English

Problem : https://www.spoj.com/problems/COOLNUMS/
My dp states : dp[N][partition_1_sum][partition_2_sum][2]
but this is incorrect as we also have to keep track of the order in which numbers are added i guess. can someone tell me what's the approach and how have you implemented it?
My code : https://ideone.com/qw85QZ

  • Vote: I like it
  • -17
  • Vote: I do not like it

| Write comment?