题目用字典树可以过,可是我写的字典树一直各种错误,,,所以,我用了别的更简便的方法、、//去你妹的一直有问题的字典树!!!////字典树,树的根是空的//////#include//#include////#include//#include//#include////#include////#in... Read More
posted @ 2014-08-13 16:18 laiba2004 Views(120) Comments(0) Diggs(0) Edit
题目用map写超便捷也可以用字典树来写我以前是用map的:#include#include#include#include#include#include #includeusing namespace std;string word[50010];int main(){ int i=0,n,... Read More
posted @ 2014-08-13 11:12 laiba2004 Views(120) Comments(0) Diggs(0) Edit
题目字典树,注意初始化的位置~!!位置放错,永远也到不了终点了org。。。。我是用数组模拟的字典树,这就要注意内存开多少了,,要开的不大不小刚刚好真的不容易啊。。。。我用了val来标记是否是同一个串分解而来的,保存的是串的编号num记录数目。//string &replace(iterator fi... Read More
posted @ 2014-08-13 10:54 laiba2004 Views(130) Comments(0) Diggs(0) Edit