摘要: 很抱歉,这是错的--坑爹啊,我做一道字典树+dp的题目,用这模版,一直wa,我一只以为是dp转移错了,谁知道,竟然是字典树模版错了-- 阅读全文
posted @ 2012-12-07 11:51 紫忆 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string.h>using namespace std;#define max 26typedef struct tree{ tree *next[26]; int v;}tree;tree tmp;tree *root=&tmp;void creat(char str[]){ int len=strlen(str);// printf("\n%d\n",len); tree *p=root,*q; for(int i=0;i<len;i++) { int x=str[i]- 阅读全文
posted @ 2012-12-07 11:50 紫忆 阅读(178) 评论(0) 推荐(0) 编辑