比赛 期末考试0 评测结果 EWEEEEEEEE
题目名称 学姐的下午茶 最终得分 0
用户昵称 汐汐很希希 运行时间 1.251 s
代码语言 C++ 内存使用 3.40 MiB
提交时间 2026-02-07 10:31:40
显示代码纯文本
#include<bits/stdc++.h>
#define ll long long
const int N=20+10;
const int M=1e5+10;
const int MOD=1e9+7;
const int MAXX=2e9;
using namespace std;
int n;
class made{
public:
    int f;
    int son[27];
}a[N]; 
string s;
int tot;
void insert(){
    int len=s.length(),p=0;
    for(int i=0;i<len;i++){
        int u=s[i]-'0';
        if(a[p].son[u]==0) a[p].son[u]=++tot;
        p=a[p].son[u];
    }
    a[p].f++; 
}
int main()
{
    freopen("lowtea.in","r",stdin);
    freopen("lowtea.out","w",stdout);
    
    cin>>n;
    for(int i=1;i<=n;i++) cin>>s,insert();
    cout<<tot+1<<endl;
    return 0;
}