#P14357. [CSP-J 2025] 拼数
[CSP-J 2025] 拼数
Problem Description
Little R is learning string processing. Little X gives Little R a string , where contains only lowercase English letters and digits, and contains at least one digit among . Little X wants Little R to use any number of the digits in , in any order, to form a positive integer. Note: Little R may choose identical digits in , but each digit can be used only once. For example, if is , then Little R may choose the -st, -rd and -th characters at the same time, which are , and form the positive integer or ; however, Little R cannot form the positive integer , because contains only two digits . Little R wants to know, among all the positive integers he can form, which one is the largest. You need to help Little R find the maximum positive integer he can form.
Input Format
The first line of input contains a string , representing the string Little X gives to Little R.
Output Format
Output one positive integer on a single line, representing the maximum positive integer Little R can form.
5
5
290es1q0
92100
Hint
Example 2 Explanation
contains the digits . It can be proven that the maximum positive integer Little R can form is .
Example 3
See and in the contestant directory. This example satisfies the constraints of test points .
Example 4
See and in the contestant directory. This example satisfies the constraints of test point .
Constraints
Let be the length of the string . For all test data, it is guaranteed that:
- ;
- contains only lowercase English letters and digits, and contains at least one digit among .
::cute-table{tuack}
| Test point | Special property | |
|---|---|---|
| A | ||
| ^ | ||
| ^ | None | |
| A | ||
| ^ | None | |
| A | ||
| ^ | None | |
| A | ||
| ^ | None | |
| A | ||
| ^ | B | |
| None | ||
| A | ||
| ^ | B | |
| None | ||
- Special property A: contains only digits.
- Special property B: contains at most digits.
Translated by QwenWork