hiho week 131 register

Ended

Participants:147

Verdict:Accepted
Score:100 / 100
Submitted:2017-01-07 10:09:47

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 <iostream>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
const int MAXL=1000000;
const int MAXM=MAXL*2+10;
int n = 0,len,st;
int maxlen[MAXM],minlen[MAXM],trans[MAXM][26],slink[MAXM],green[MAXM];
int tot[MAXM],que[MAXM],sz_end[MAXM];
int visited[MAXM];
char s[MAXM],t[MAXM];
int new_state(int _maxlen,int _minlen,int* _trans,int _slink,int _green) {
    maxlen[n] = _maxlen;
    minlen[n] = _minlen;
    for(int i = 0; i < 26; i++) {
        if(_trans==NULL) {
            trans[n][i] = -1;
        } else {
            trans[n][i] = _trans[i];
        }
    }
    slink[n] = _slink;
    green[n] = _green;
    return n++;
}
int add_char(char ch,int u) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX