oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

blanko Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

blanko.html

Problem Description

Rar the Cat is trying out his new correction tape. He takes a sheet of paper, containing an N-digit integer, and decides to remove K of these digits. The remaining digits will join together to form a new integer with N - K digits.

Help Rar find the minimum possible integer he can form. Note that the resultant integer cannot have leading zeroes.

Input

The first line of input will contain two integers, N and K.

The second line of input will contain one integer, representing the original integer Rar has.

Output

Output a single line containing one integer, the minimum possible resultant integer Rar can form.

Limits

1 ≤ K < N.

Subtask 1 (8%): 2 ≤ N ≤ 16.

Subtask 2 (12%): 2 ≤ N ≤ 2 000. Each digit in the integer will be a 0 or a 1.

Subtask 3 (14%): 2 ≤ N ≤ 2 000.

Subtask 4 (6%): 2 ≤ N ≤ 100 000. K = N - 1.

Subtask 5 (16%): 2 ≤ N ≤ 100 000. Each digit in the integer will be a 0 or a 1.

Subtask 6 (18%): 2 ≤ N ≤ 100 000. No digit in the original integer will be a 0.

Subtask 7 (15%): 2 ≤ N ≤ 100 000.

Subtask 8 (11%): 2 ≤ N ≤ 5 000 000.

Subtask 9 (0%): Sample Testcases

Sample Testcase 1

Input

5 3
23195

Output

15

Sample Testcase 2

Input

10 6
9031193452

Output

1132

Sample Testcase 3

Input

5 2
10101

Output

100

Tags

Greedy

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
18250.5s256MBMinimum
212230.5s256MBMinimum
314650.5s256MBMinimum
46220.5s256MBMinimum
516440.5s256MBMinimum
618160.5s256MBMinimum
7151460.5s256MBMinimum
8111660.5s256MBMinimum
9030.5s256MBMinimum

Judge Compile Command

g++-8 ans.cpp -o blanko -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.