Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <unordered_map>#include <string>#include <vector>#include <iostream>using namespace std;const int MAXN = 10000;struct Trie{unordered_map<string, Trie*> mp;unordered_map<string, int> cnt_mp;};int main(){int n;while(cin >> n){Trie *root = new Trie();vector<string> s(n, "");for(int i=0; i<n; ++i){cin >> s[i];Trie *tmp = root;size_t sd = 1, fd = s[i].find('/', sd);while(fd != string::npos){string t = s[i].substr( sd, fd - sd );if(tmp->mp.find( t ) == tmp->mp.end()){tmp->mp[ t ] = new Trie();tmp->cnt_mp[ t ] = 1;}else{tmp->cnt_mp[ t ] += 1;