[洛谷P2580]于是他错误的点名开始了(Trie树)


传送门

洛谷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



上一篇:NOIP2009T3最优贸易(Dfs + spfa)

下一篇:【模板】二分图最大权完美匹配KM算法


trie树
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图