hiho week 78 register

Ended

Participants:288

Verdict:Accepted
Score:100 / 100
Submitted:2015-12-26 20:35:05

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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 ++;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX