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

建议使用的浏览器:

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

2698:URL

题目描述
WHU ACM Team is working on a brand new web browser named "Whu-Super-Browser". You're in response for a
powerful feature: recording the previous addresses. Moreover, when a string is inputted, the browser will display all the
addresses start with it. The addresses shall be sorted by visited times, in descending order. This feature is very useful to
users.
Can you complete it?

There're two kinds of operations:
Visit [url_str] : visit a website with the URL: [url_str].
Display [str] : display all addresses start with [str] and sort them by visited times, in descending order. If two addresses
have the same visited times, then sort them in the lexicographical order.
输入解释
The input consists of multiple test cases. The first line of input contains an integer T, which is the number of test cases.

Each test case is on several lines.
The first line of each test case consists of an integer N.
Each of the following N lines consists of an operation, Visit or Display.

[Technical Specification]
T is an integer, and T <= 10.
N is an integer, and 1 <= N <=100.
There's NO blank line between test cases.
[url_str] and [str] only contains lower case letters 'a' - 'z', '.', '/', ':'.
The length of [url_str] and [str] is greater than 0 and won't exceed 100.
输出解释
For each test case, display addresses as required, each address on a separated line.
Add a blank line after each 'Display' operation.
输入样例
1 
10 
Visit http://acm.whu.edu.cn 
Visit http://acm.pku.edu.cn 
Visit http://acm.timus.ru 
Visit http://acm.whu.edu.cn 
Visit http://acm.whu.edu.cn 
Visit http://acm.pku.edu.cn 
Display http://acm 
Visit baidu.com 
Visit www.whu.edu.cn 
Display b 
输出样例
http://acm.whu.edu.cn 
http://acm.pku.edu.cn 
http://acm.timus.ru 

baidu.com 
来自杭电HDUOJ的附加信息
Recommend yifenfei

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

源链接: HDU-2698

最后修改于 2020-10-25T22:56:02+00:00 由爬虫自动更新

共提交 0

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