BZOJ1633 [Usaco2007 Feb]The Cow Lexicon 牛的词典
本来想做点英语作业的。想10分钟把这题搞定的。结果傻了去写trie树dp又傻了没有考虑终点也可以有子结点。 我真是无药可救了。 #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int tcnt; struct trie_node { int d, e, t[26]; inline trie_node(int d0 = 0) { e = 0; d = d0 + 1; memset(t, 0, sizeof(t)); } inline int ins(char c) { if (!t[c - 97]) t[c - 97] = ++ tcnt; return t[c - 97]; } inline int trans(char c) { return t[c - 97]; } }; const int inf = 0x3f3f3f3f; const int maxs = 15009;...