#P1106. 删数问题
删数问题
Description
Input a high-precision positive integer (no more than digits). After removing any digits, the remaining digits, kept in their original left-to-right order, form a new non-negative integer. Given and , write a program to find a strategy to remove digits so that the resulting number is minimal.
Input Format
The input consists of two lines of positive integers.
The first line contains the high-precision positive integer .
The second line contains the positive integer , the number of digits to delete.
Output Format
Output a single integer: the minimal possible remaining number.
175438
4
13
Hint
Let denote the number of digits of , and it is guaranteed that .
Note: after deleting some digits, the remaining number may have leading zeros, but do not output leading zeros.
Translated by ChatGPT 5
京公网安备 11011102002149号