| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 4 초 | 2048 MB | 25 | 7 | 6 | 27.273% |
You are given an array $a$ of $n$ integers. You can perform operations on this array. In a single operation, you can add any real number $x$ to some consecutive interval of $a$.
Determine the minimum number of operations that have to be performed to make all elements of $a$ equal to 0ドル$.
The first line contains an integer $n$ (1ドル \leq n \leq 23$).
The second line contains the array $a_1, a_2, \ldots, a_n$ (0ドル \leq a_i \leq 10^9$).
Print a line with a single integer: the minimum number of operations needed.
5 1 2 3 2 1
3
6 1 1 4 5 1 4
4