Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.
→ Practice?
Want to solve the contest problems after the official contest ends? Just register for practice and you will be able to submit solutions.
Given an array $$$a$$$, find the largest sum of a (possibly empty) subarray.
Input
The input consists of:
One line with one integer $$$n$$$ ($$$1 \leq n \leq 3 \cdot 10^5$$$), the length of the array.
One line with $$$n$$$ integers $$$x_i$$$ ($$$1 \leq \left\vert x_i \right\vert \leq 10^9$$$). If $$$x_i \gt 0$$$, this means that $$$a_i = 2^{x_i}$$$. Otherwise, $$$a_i = - 2^{-x_i}$$$.
Output
Output one integer, the answer modulo $$$998244353$$$.