AstaK's blog

By AstaK, history, 3 hours ago, In English

Given an array of length $$$n$$$ consisting of non-negative integers and an even integer $$$k$$$. Select $$$p$$$ $$$($$$ $$$p$$$ even $$$)$$$ integer indices $$$\left( i_{p_1} \lt i_{p_2}\lt ...\lt i_{p_\left| p \right|} \right),(p\le k)$$$. Compute the maximum value of $$$S=-a_{i_{p_1}}+a_{i_{p_2}}-a_{i_{p_3}}+a_{i_{p_4}}-...+a_{i_{p_\left| p \right|}}$$$

$$$ 1 \le n \le 5.10^5$$$

$$$ 0 \le k \le \left\lfloor n/2 \right\rfloor $$$

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 hours ago, # |
  Vote: I like it +4 Vote: I do not like it

aliens trick