UVALive 3942 - Remember the Word 字典树+dp
摘要:
状态转移方程很容易想出,和背包思想有点像,难点在如何如何用字典树来搞dp,ps:原来在建stuct时初始化时可以节省不少时间的!!#include#includeusing namespace std;const int max_node=400100;const int modn=20071027;const int son_num=26;int ch[max_node][son_num];int val[max_node];int sz;int dp[300100];struct trie{ trie() { sz=1; memset(ch,0,si... 阅读全文
posted @ 2013-11-14 20:11 Hungry3 阅读(147) 评论(0) 推荐(0)
浙公网安备 33010602011771号