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:
I just did a simple way by having two variables (
minAnsandmaxAns), submissionIn 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
WAcasea=[-2, 1, -3, 5], your code outputs0but correct answer is2, by picking:-2), score is-2, array is[1, -3, 5]-3), score is1, array is[1, 5]1), score is2, array is[5]Also I am Expert, not Candidate Master (by magic)