Hungry3

梦想到达塔顶的蜗牛

2013年11月14日

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)

量变与质变

摘要: 今天哲学老师的一句“量变必然会引起质变,但量变又不仅仅是数量上的变化,例如石墨和金刚石,金刚石比石墨硬度更大,不是因为金刚石拥有更多的碳元素,而是因为碳元素结合的方式不同,所以量变也有结构上,形式上的巨变,这样的量变有时才是推动质变的根源”,令我大切大悟。 阅读全文

posted @ 2013-11-14 19:06 Hungry3 阅读(401) 评论(0) 推荐(0)

导航