传送门
洛谷P2580的一个水题,用啥都能过,不过为了练习一下刚刚学会的字典树,还是认真做一下吧。
#include <cstdio> #include <cstring> using namespace std; #define idx(x) x 'a' int n, m, nex; struct node tree[1000001]; void Insert(char *s) tree[rt].val = 1; } int Find(char *s) if(tree[rt].val == 1) else return 2; } int main() scanf("%d", &m); for(i = 1; i <= m; i++) return 0; }View Code
上一篇:NOIP2014D2T2寻找道路(Spfa)
下一篇:【模板】最小费用最大流
trie树









