2018 US group comments spring C ++ exam programming questions-digital characters, 2018 US dollars
Comments from the US Mission: 2018 online examination for the development direction of the spring recruitment background
Programming question | 30.0 points 2/2
Numeric characters
Time limit:The C/C ++ language is 2000 MS; other languages are 4000 MS.
Memory limit:C/C ++ language 65536KB; other languages 589213kb
Description:
In decimal notation, any positive integer can be expressed with the character '0'-'9. However, when the number of each character of '0'-'9' is limited, some positive integers may not be expressed. For example, if you have two '1' and one '2', you can represent 11,12, 121, and so on, but not 10,122,200.
Now you have some characters in your hand. They are all '0'-'9' characters. You can select some of the characters and combine them into a number. What is the smallest positive integer you cannot constitute?
Input
The first line contains a string consisting of '0'-'9', indicating the characters you can use.
· 1 ≤ string length ≤ 1000.
Output
Output the smallest positive integer that you cannot form.
?
Sample Input
55
Sample output
1
?
Hint
Input Sample 2
123456789
Output Sample 2
10