2 shunfurh shunfurh 于 2017.01.05 17:05 提问

怎么解决kiki的魔法电灯问题

Problem Description
Kiki likes traveling. One day she finds a magic lamp, unfortunately the genie in the lamp is not so kind. Kiki must answer a question, and then the genie will realize one of her dreams.
The question is: give you an integer, you are allowed to delete exactly m digits. The left digits will form a new integer. You should make it minimum.
You are not allowed to change the order of the digits. Now can you help Kiki to realize her dream?

Input
There are several test cases.
Each test case will contain an integer you are given (which may at most contains 1000 digits.) and the integer m (if the integer contains n digits, m will not bigger then n). The given integer will not contain leading zero.

Output
For each case, output the minimum result you can get in one line.
If the result contains leading zero, ignore it.

Sample Input
178543 4
1000001 1
100001 2
12345 2
54321 2

Sample Output
13
1
0
123
321

1个回答

caozhy
caozhy   Ds   Rxr 2017.01.05 23:54
已采纳
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
kiki修改版qq魔法表情(200个表情)
kiki修改版qq魔法表情(200个表情),内有详细说明。
HDU 2147kiki's game (巴什博弈)
kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others) Total Submission(s): 9213    Accepted Submission(s): 5512 Problem Description Recently kiki
java中的魔法数
说明:所谓魔法数值,是指在代码中直接出现的数值,而只有在这个数值记述的那部分代码中才能明确了解其含义。   魔法数值使代码的可读性大大下降。而且,如果同样的数值多次出现时,到底这些数值是不是带有同样的含义呢,谁也说不清楚。另一方面,如果本来应该使用相同数值的地方,一旦用错了,也很难发现。因此,需要注意以下几点,极力避免使用魔法数值。   ① 不使用魔法数值,代之以有名字的Sta
HDU 2147 kiki's game (巴什博弈)
kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/1000 K (Java/Others) Total Submission(s): 5982    Accepted Submission(s): 3552 Problem Description Recently kiki h
HDOJ 2147 kiki's game(基础博弈)
kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others) Total Submission(s): 8480    Accepted Submission(s): 5053 Problem Description Recently kik
kiki's game(博弈)
kiki's game Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 40000/10000 K (Java/Others) Total Submission(s): 7836    Accepted Submission(s): 4654 Problem Description Recently kiki
hdu 2276 Kiki & Little Kiki 2
点击打开hdu 2276 思路: 矩阵快速幂 分析: 1 题目给定一个01字符串然后进行m次的变换,变换的规则是:如果当前位置i的左边是1(题目说了是个圆,下标为0的左边是n-1),那么i就要改变状态0->1 , 1->0    比如当前的状态为100101那么一秒过后的状态为010111 2 假设0/1串的长度为n,保存在a数组,下标从0开始    根据上面的规则我们发现可以得出一秒
魔法城市路径问题(腾讯2017校招笔试题)
腾讯校招的笔试题目:魔法城市路径问题
魔法隧道
第一步:下载魔法隧道并注册 第二步:打开cmd命令窗口把魔法隧道的路径 和隧道token复制进去 按回车 C:\Users\Administrator\Desktop\mofasuidao.exe 8dcfef8b-d536-4f60-984e-463acc5558ef http://www.mofasuidao.cn/rest/page/controlcenter 第三步:把lo
hdu 2113 很容易就PE的问题
Secret Number Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7370    Accepted Submission(s): 3126 Problem Description 有一天, KIKI 收到