
Trie
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
hdu 1671 Phone List
Trie 树裸题,写tire 的时候应该想想trie的图,当前的str【0】应该为下一步要走的边。 #include <bits/stdc++.h> using namespace std; const int maxn = 20; const int maxnode = 100001; int ch[maxnode][10],isend[maxnode],tot = 0; bo...原创 2019-08-18 16:50:14 · 105 阅读 · 0 评论 -
hdu 6625 three arrays
这道题的贪心想法是这样的,我们希望产生的最小值越多越好,那么如果对于当前的某一位,同时走 1 或者同时 走 0 的匹配一定比 一个走1,一个走 0 的 要小,那么一直执行这样一个递归的过程,我们就可以得到最小的值。 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn =...原创 2019-08-19 20:52:52 · 196 阅读 · 0 评论