DCP-139: Game Show Back to All Problems

Medium Divide and Conquer > Greedy


Galib is participating in a Tv game show “kam nai tai show kori” । Where as a winner of every show participate can take money as many as they want but there is a simple restriction to do so . In the end part of the show , the presenter writes a number of N digits in a board. The participant must then erase exactly M digits from the number in the board; the number formed by the remaining digits is the value of the money prize for the participant. As a very good programmer Galib is obvious going to take the highest value from it . Can you tell the highest value of prize Galib is going to take . Input: ------ The first line contains an integer T i.e. the number of Test cases. T test cases follow. Each test case has 2 lines. The first line contains N( number of digits the presenter writes in the black board ) and M (the number of digits that must be erased.).The second line contains n digits of number and the number doesn’t start with zero . Output: ------- For each test case, print a line “Case x: y” where x is replaced by the test case number and y is the highest prize Galib can win. Constraints: ------- 1<= T <= 100 2 <=N <=1000 1<= M <= N – 1 Sample Input ------------ 2 3 1 591 6 3 123123 Sample Output ------------- Case 1: 91 Case 2: 323


Problem Setter:

Shakil Ahmed

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 3.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

68/190

Solve/Submission

Ranking

# User Language Timing
01 skmonir Cpp 0.00s
02 Jisancse C 0.00s
03 emrul Cpp14 0.00s
04 prodipdatta7 Cpp14 0.00s
05 Morass Cpp14 0.00s
06 Islam_Rafat Cpp14 0.01s
07 feodorv C 0.01s
08 rayhan50001 Cpp 0.01s
09 tariqiitju Cpp 0.01s
10 robin_aust Cpp 0.01s
11 CLown1331 Cpp 0.01s
12 ehsan_sshuvo Cpp 0.01s
13 seyedssz Cpp14 0.02s
14 _dipu Cpp14 0.02s
15 Robbinb1993 Cpp14 0.02s
16 Sarwar05 Cpp14 0.02s
17 clcrr Cpp14 0.23s
18 mamun4122 Cpp14 0.30s
19 Zeronfinity Cpp14 0.32s
20 ih_hira Cpp14 0.33s
21 kazinayeem Cpp14 0.33s
22 imranziad Cpp14 0.39s
23 mahbubcseju Cpp14 0.40s
24 showmic Cpp14 0.40s
25 jayanto Cpp14 0.40s
26 Mehedimuaz Cpp14 0.41s
27 anowar1112 Cpp14 0.41s
28 underSpirit Cpp14 0.42s
29 shapnil092 Cpp14 0.43s
30 dip_BRUR Cpp14 0.44s
31 adnanSharif Cpp14 0.46s
32 habib_rahman Cpp14 0.47s
33 kitorp Cpp14 0.47s
34 partha_mbstu Cpp14 0.48s
35 eltonrawn Cpp14 0.48s
36 evan Cpp14 0.48s
37 abid1 Cpp14 0.48s
38 sahedsohel Cpp14 0.48s
39 ksohan Cpp14 0.48s
40 Skyfall009 Cpp14 0.49s
41 Mahmudul_Tushar Cpp14 0.50s
42 murad_al_wajed Cpp14 0.51s
43 t_zilani Cpp14 0.52s
44 siamcr7 Cpp14 0.55s
45 swapnil Cpp14 0.57s
46 fsshakkhor Cpp14 0.58s
47 alhelal_cse Cpp14 0.59s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support