| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 100 | 55 | 50 | 56.818% |
Jack has $N$ coins, with values $M_1,ドル $M_2,ドル \dots, $M_N$. Find the smallest positive amount that cannot be paid with these coins with no change.
The first line contains $N$ (1ドル \le N \le 1,000円$), the number of coins. The second line contains $N$ integers $M_i$ (1ドル \le M_i \le 1,000円,000円$), the values of the coins.
The only line should contain a single positive integer: the smallest amount that Jack cannot pay with his coins.
3 1 2 5
4
These coins can be used to pay the amounts 1ドル,ドル 2ドル,ドル and 3ドル = 1 + 2,ドル but it's not possible to pay the amount 4ドル$ exactly.
3 1 2 2
6
These coins can be used to pay any amount from 1ドル$ to 5ドル,ドル but there's just not enough money to pay the amount 6ドル$.
Olympiad > Estonian Informatics Olympiad > 2020-21 > Final Round 1번