我下载了 #1数据,发现答案一模一样,却全WA了,QAQ
#include<bits/stdc++.h>
using namespace std;
int n,ans;
string s;
struct No
{
map < string,int > next;
}tree[50011];
int main()
{
ios::sync_with_stdio(false);
scanf("%d",&n);
for(int i = 1;i <= n;i ++)
{
cin >> s;
int l = 0,r,d = 0;
for(int j = 1;j <= s.size();j ++)
{
if(s[j] == '/' || j == s.size())
{
string v = s.substr(l + 1,j - l - 1);
if(!tree[d].next[v])
tree[d].next[v] = d = ++ans;
else d = tree[d].next[v];
l = j;
}
}
printf("%d\n",ans);
}
return 0;
}