A10316 | Hostname Aliases
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The first line of the input contains a single integer $n$ ( $1<=n<=100000$ ) — the number of page queries. Then follow $n$ lines each containing exactly one address. Each address is of the form http://<hostname>\[/<path>\], where:
- <hostname> consists of lowercase English letters and dots, there are no two consecutive dots, <hostname> doesn't start or finish with a dot. The length of <hostname> is positive and doesn't exceed $20$ .
- <path> consists of lowercase English letters, dots and slashes. There are no two consecutive slashes, <path> doesn't start with a slash and its length doesn't exceed $20$ .
Addresses are not guaranteed to be distinct.
- <hostname> consists of lowercase English letters and dots, there are no two consecutive dots, <hostname> doesn't start or finish with a dot. The length of <hostname> is positive and doesn't exceed $20$ .
- <path> consists of lowercase English letters, dots and slashes. There are no two consecutive slashes, <path> doesn't start with a slash and its length doesn't exceed $20$ .
Addresses are not guaranteed to be distinct.
输入格式
First print $k$ — the number of groups of server names that correspond to one website. You should count only groups of size greater than one.
Next $k$ lines should contain the description of groups, one group per line. For each group print all server names separated by a single space. You are allowed to print both groups and names inside any group in arbitrary order.
Next $k$ lines should contain the description of groups, one group per line. For each group print all server names separated by a single space. You are allowed to print both groups and names inside any group in arbitrary order.
输出格式
无
输入输出样例
输入 #1
10 http://abacaba.ru/test http://abacaba.ru/ http://abacaba.com http://abacaba.com/test http://abacaba.de/ http://abacaba.ru/test http://abacaba.de/test http://abacaba.com/ http://abacaba.com/t http://abacaba.com/test
输出 #1
1 http://abacaba.de http://abacaba.ru
输入 #2
14 http://c http://ccc.bbbb/aba..b http://cba.com http://a.c/aba..b/a http://abc/ http://a.c/ http://ccc.bbbb http://ab.ac.bc.aa/ http://a.a.a/ http://ccc.bbbb/ http://cba.com/ http://cba.com/aba..b http://a.a.a/aba..b/a http://abc/aba..b/a
输出 #2
2 http://cba.com http://ccc.bbbb http://a.a.a http://a.c http://abc
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted