hiho week 84 register

Ended

Participants:186

Verdict:Accepted
Score:100 / 100
Submitted:2016-02-12 19:36:17

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 <cstdio>
#include <cstring>
bool vis[101];
struct node
{
    node* chd[26];
    bool f;
    void init()
    {
        memset(chd,0,sizeof(chd));
        f=0;
    }
}buff[1000006];
int cc=0,top;
node* newnode()
{
    buff[++cc].init();
    return buff+cc;
}
char in[105];
char stk[105];
node*root=buff;
void ins()
{
    char*p;
    node*cur;
    for(cur=root,p=stk;*p;++p)
    {
        if(!cur->chd[*p-'a'])
            cur->chd[*p-'a']=newnode();
        cur=cur->chd[*p-'a'];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX