博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
poj--3630+字典树基础题
阅读量:2228 次
发布时间:2019-05-09

本文共 458 字,大约阅读时间需要 1 分钟。

先按长度排序,先先插入长的,在插入的时候同时进行查询。

#include
#include
#include
#include
using namespace std;typedef struct{ char str[12];}P;P p[200000];bool cmp(P p1,P p2){ if(strlen(p1.str)>strlen(p2.str)) return true; return false;}typedef struct{ int cnt; int next[11];}N;N node[200000];int top;int insert(char *str){ int len=strlen(str); int t=0; for(int i=0;i
=n) printf("YES\n"); } return 0;}

转载地址:http://kkrfb.baihongyu.com/

你可能感兴趣的文章
【C语言】深度理解函数的调用(栈帧)
查看>>
【Linux】进程的理解(三)
查看>>
【C++】带头节点的双向线链表的实现
查看>>
【C++】STL -- Vector容器的用法
查看>>
【Linux】Linux中的0644 和 0755的权限
查看>>
【数据结构】有关二叉树的面试题
查看>>
【Linux】内核态和用户态
查看>>
【Linux】HTTP的理解
查看>>
【Linux】HTTPS的理解
查看>>
【操作系统】大小端问题
查看>>
Git上传代码时碰到的问题及解决方法
查看>>
【Linux】vim的简单配置
查看>>
【C++】智能指针
查看>>
【C++】const修饰的成员函数
查看>>
【C++】面向对象的三大特性
查看>>
【C++】智能指针(后续)
查看>>
【C】堆区和栈区的区别
查看>>
【linux】send和recv函数解析
查看>>
【Linux】线程安全的单例模式以及计算密集型线程和IO密集型线程
查看>>
一次完整的HTTP请求是怎样的??
查看>>