作业帮 > 英语 > 作业

ACM题一道,原题 zstuoj2511Delete NumberTime Limit:1000MS Memory Li

来源:学生作业帮 编辑:拍题作业网作业帮 分类:英语作业 时间:2024/04/28 07:30:15
ACM题一道,
原题 zstuoj2511
Delete Number
Time Limit:1000MS Memory Limit:65536K
Total Submit:669 Accepted:121
Description
Given 2 integer number n and m.You can delete m digits from the number n,then number n changes to a new number n1.Tell me how to delete the number,you can get the smallest one.
For example,
m:1 n:1456
n1 may be 145,156,146,456
the smallest one is 145.Then n1 should be 145.
Input
The input consists of T test cases.The number of them (T) is given on the first line of the input file.Each test case consists of one single line containing two integer number m(1
思路很简单,从前往后找每次删除第一个比后边大的数字,如果到末尾了则每次删除末尾数字即可.