HDU 1251:统计难题
发布日期:2021-06-30 16:05:50 浏览次数:2 分类:技术文章

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

经典字典树题

就是输入不太友好,因为我平时不喜欢用 gets()
我一般用 scanf("%[^\n]",ch) 来代替 gets(ch) ,ch 是 char* 类型的,这里利用了正则表达式的性质,让 scanf() 达到了gets()的效果,也保留了 scanf() 的优点
如果有大佬可以不用gets()函数的,请留言告知,万分感谢!

我的代码:

#include
#include
using namespace std;const int maxn=400000+100;int trie[maxn][26],sum[maxn],tot;void insert(char* ch){
int len=strlen(ch); int root=0; for(int i=0;i

转载地址:https://kaven.blog.csdn.net/article/details/81162895 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:CODEVS 4189 : 字典
下一篇:牛客小白月赛5 : A D F G H I J

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年04月07日 18时27分06秒