hiho Week 4 register

Ended

Participants:617

Verdict:Accepted
Score:100 / 100
Submitted:2014-08-02 18:32:54

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 <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <functional>
#include <numeric>
#include <cctype>
using namespace std;
const int MAX_PATTERN_NUM = 1010;
const int MAX_PATTERN_LEN = 1000010;
//const int MAXQ = MAX_PATTERN_NUM * MAX_PATTERN_LEN;
const int MAXQ = 1000010;
const int MAX_TEXT_LEN = 1000100;
const int MAXK = 26; //
const char BASE = 'a';
typedef struct TrieNode {
    TrieNode* fail;
    TrieNode* next[MAXK];
    int cnt;
    TrieNode() {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX