hiho week 131 register

Ended

Participants:147

Verdict:Wrong Answer
Score:0 / 100
Submitted:2016-12-31 22:45:40

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>
typedef long long LL;
LL ans;
char s[100005],t[100005];
int L,T,tt,vis[200005];
struct node
{
    node*ch[26],*pre;
    int len;
    LL cnt;
    void init(int _len=0)
    {
        len=_len;
        cnt=1;
        memset(ch,0,sizeof(ch));
        pre=0;
    }
}buff[200005],*p,*np,*q,*nq,*root=buff;
int cnt;
node* newnode(int _len=0)
{
    buff[++cnt].init(_len);
    return buff+cnt;
}
void ins(char c)
{
    np=newnode(p->len+1);
    for(;p;p=p->pre)
    {
        if(!p->ch[c-'a'])
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX