#P8082. [COCI 2011/2012 #4] KEKS
[COCI 2011/2012 #4] KEKS
Description
Given positive integers and an -digit number, find the maximum value of the number remaining after deleting digits from the -digit number.
Input Format
The first line contains two integers .
The second line contains an -digit integer. It is guaranteed to have no leading .
Output Format
Output the maximum value of the remaining number.
4 2
1924
94
7 3
1231234
3234
10 4
4177252841
775841
Hint
【Constraints】
- For of the testdata, .
- For of the testdata, .
【Hints and Notes】
This problem is translated from COCI 2011-2012 CONTEST #4 Task 3 KEKS.
The score setting of this problem follows the original COCI problem, with a full score of .
Translated by ChatGPT 5
京公网安备 11011102002149号