No Change
시간 제한: 1000ms메모리 제한: 1024MB출처: EIO 2020-21 finalBOJ 29900
문제
Jack has coins, with values , , \dots, . Find the smallest positive amount that cannot be paid with these coins with no change.
입력
The first line contains (), the number of coins. The second line contains integers (), the values of the coins.
출력
The only line should contain a single positive integer: the smallest amount that Jack cannot pay with his coins.
예제
예제 1
입력
3 1 2 5
출력
4
예제 2
입력
3 1 2 2
출력
6
코드를 제출하려면 로그인하세요.