CF644C.Hostname Aliases

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line of the input contains a single integer nn ( 1<=n<=1000001<=n<=100000 ) — the number of page queries. Then follow nn lines each containing exactly one address. Each address is of the form http://[/], where:

  • consists of lowercase English letters and dots, there are no two consecutive dots, doesn't start or finish with a dot. The length of is positive and doesn't exceed 2020 .
  • consists of lowercase English letters, dots and slashes. There are no two consecutive slashes, doesn't start with a slash and its length doesn't exceed 2020 .

Addresses are not guaranteed to be distinct.

输入格式

First print kk — the number of groups of server names that correspond to one website. You should count only groups of size greater than one.

Next kk 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 
    
首页