TopCoder

icube
baluteshih 好強 <(_ _)>

User's AC Ratio

89.7% (26/29)

Submission's AC Ratio

29.9% (40/134)

Tags

Description

給你一個 n 位數的正整數 A,請問刪除其中 k 位數(k< n)、將剩下的數字依序合併形成一個新的正整數 B,B的最小可能值是多少?

請注意,A和B的首位都不能是0。

Input Format

輸入檔可能包含多筆測試資料,並且以EOF作結束。

每筆測試資料中:
第一列有兩個正整數 n, k (1≦k< n≦100,000)。
第二列會有一個長度為 n 的正整數 A。

Output Format

請輸出 B 的最小可能值。

Sample Input 1

6 4
178543
5 2
30102

Sample Output 1

13
102

Hints

Problem Source

原TIOJ1397 / 快樂暑假第四次練習比賽。Problem Setter: Tmt。

Subtasks

No. Testdata Range Score
1 0 25
2 1 25
3 2 25
4 3 25

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 1500 65536 262144 1
1 1500 65536 262144 2
2 1500 65536 262144 3
3 1500 65536 262144 4