| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 33 | 20 | 18 | 60.000% |
These days, all eyes and money are on crypto. The stakes are high and a team of experts, which call themselves the FPC (Fabulous People of Crypto) are on the verge of a big move. They call their move "The Bubble".
The Bubble will work as follows: one day, the FPC will release a set of classified information that will shake the market to its roots. That day, call it $x$, will be the epicenter of their move. To measure the impact of The Bubble, consider the longest sequence of consecutive days, starting on day $a$ and ending on day $b$ ($a\leq x\leq b$), for which Bitcoin's price is never lower than its price on day $x$. The impact is measured as the length of this sequence in days multiplied by the price of Bitcoin on day $x$. The starting day and the end day of The Bubble's impact should be within the boundaries of the period the FPC know the price for.
There is only one catch: despite anticipating Bitcoin's price for the foreseeable future, the FPC lack the most fabulous skill in the world: programming. Help them measure the biggest possible impact of The Bubble, given that they release the shocking information on an optimal day.
The input consists of:
Price information is given in chronological order.
Output a single number, the biggest impact The Bubble can have.
4 3 2 9 4 5 2 7 4
50
Figure B.1: A visualisation of the first sample input. The orange rectangle indicates the maximum impact of The Bubble. Day 7 (marked in green) is the epicenter of The Bubble.
10 5 5 8 1 8 3 9 1 0 6 1 6 1 5 6 2 6 5 9 6
78