CSES Problemset/Sorting and Searching
Missing Coin Sum
#2183Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude DesktopYou have coins with positive integer values. What is the smallest sum you cannot create using a subset of the coins?
Input
The first line has an integer : the number of coins.
The second line has integers : the value of each coin.
Output
Print one integer: the smallest coin sum.
Constraints
Sample Test Cases (1)
Example 1ID: sample-1
Input
5 2 9 1 2 7
Expected Output
6
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|1 line, 0 charsTest Bench
Input (stdin)
5 2 9 1 2 7
Expected Output
6