当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6914:Problem Select

题目描述
HOJ is an online judge system for students in HIT to practice. As the administrator, you would always setup contests by selecting problems from the problem set. Problem IDs are integers that can be phased by url. For example, the corresponding problem ID of url http://acm.hit.edu.cn/problemset/1001 is 1001.

Now the task is, given n urls, print the smallest k problem IDs in increasing order.
输入解释
The first line of the input contains one integer T (1 ≤ T ≤ 10), indicating the number of test cases.

For each test case, the first line contains two integers, n (1 ≤ n ≤ 1000) and k (1 ≤ k ≤ n).

For the next n lines,each line contains a string indicating the problem’s url. The problem ID is guaranteed to be in range [1,10000] and unique in each case.
输出解释
Output T lines.

For each test case, you should output k numbers in a line, and there shouldn’t be any spaces at the end of the line.
输入样例
2
3 2
http://acm.hit.edu.cn/problemset/1003
http://acm.hit.edu.cn/problemset/1002
http://acm.hit.edu.cn/problemset/1001
4 1
http://acm.hit.edu.cn/problemset/1001
http://acm.hit.edu.cn/problemset/2001
http://acm.hit.edu.cn/problemset/3001
http://acm.hit.edu.cn/problemset/501
输出样例
1001 1002
501
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6914

最后修改于 2021-06-22T18:18:52+00:00 由爬虫自动更新

共提交 1

通过率 0.0%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)