Comment

avatar username

When I first saw this problem, I felt that this problem is somewhat similar to 1068 B. Niko's Tactical Cards in which DP was used , as I haven't studied DP I was unable to solve it .

I just did a simple way by having two variables (minAns and maxAns), submission

In Goodbye 2025 C, I used a different approach, which is brute forcing the child not picked in all operations, by precomputing the left and right answer, submission

Also, I found the WA case a=[-2, 1, -3, 5], your code outputs 0 but correct answer is 2, by picking:

  • Pick first (-2), score is -2, array is [1, -3, 5]
  • Pick second (-3), score is 1, array is [1, 5]
  • Pick first (1), score is 2, array is [5]
  • End

Also I am Expert, not Candidate Master (by magic)

The actual rating of this user is 1545.

Original comment.

Statistics