Loading repovive.com/contests/1/problems/B
You are given an array .
You may apply the following operations to the array:
After performing exactly operations, only one element remains.
You must perform operation 1 exactly times, and operation 2 exactly times.
Among all valid sequences of operations, determine the maximum possible value of the final remaining element.
, ,
With , we only use operation 2 (delete right). This forces us to always delete rightward, so only can survive. Answer: 3.
, ,
With , we only use operation 1 (delete left). This forces us to always delete leftward, so only can survive. Answer: 5.