Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include <cstring>#include <iostream>#include <cstdio>enum {maxn = 10000+5, maxm = 2000000+5};struct Node {int num;int next[26];};Node tree[maxm];int N, M = 1;void insert(){int rt = 0;char c = getchar();while(c != '\n'){if (tree[rt].next[c-'a'] == 0){tree[rt].next[c-'a'] = M++;}rt = tree[rt].next[c-'a'];tree[rt].num++;c = getchar();}}int all = 0;int findPre(int rt){if (tree[rt].num <= 5 && rt!= 0)all ++;