callisto's blog

By callisto, history, 8 years ago, In English

code

In this code I minimize the difference between prefix sums only, but don't consider the difference of indexes. I think there might be test where prefix sums difference is bigger, but indexes difference is small, and it can be answer.

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Testcase which hack your solution

5
5 -105 -800 904 2
answer : 5
your code gives : 10