hiho Week 4 register

Ended

Participants:617

Verdict:Accepted
Score:100 / 100
Submitted:2014-07-27 21:38:46

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>
#include <queue>
int node_cnt;
struct TreeNode {
    int next[26];
    int trie;
    bool eow;
} node[1000000];
void node_insert(char *word);
void build_graph();
bool check(char *essay);
int main() {
    int N;
    char word[100010];
    char essay[1000010];
    memset(node, 0, sizeof(node));
    node_cnt = 0;
    scanf("%d", &N);
    while(N--) {
        scanf("%s", word);
        node_insert(word);
    }
    build_graph();
    scanf("%s", essay);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX