题目链接

#include<bits/stdc++.h>
using namespace std;
;

struct T
{
    int num;
    T* next[];
    T()
    {
        num=;
        int i;
        ;i<;i++)
            next[i]=NULL;
    }
}t;

void insert(char str[])
{
    T* p=&t;
    ;str[i];i++)
    {
        int a=str[i]-'a';
        if(p->next[a]==NULL)
            p->next[a]=new T;
        p=p->next[a];
        p->num++;
    }
}
int find(char str[])
{
    T* p=&t;
    ;str[i];i++)
    {
        int a=str[i]-'a';
        if(p->next[a]==NULL)
            ;
        p=p->next[a];
    }
    return p->num;
}

int main()
{
    int n,m;
    char str[L];
    scanf("%d",&n);
    while(n--)
        scanf("%s",str),insert(str);
    scanf("%d",&m);
    while(m--)
        scanf("%s",str),printf("%d\n",find(str));
}

最新文章

  1. sh7.创建yum源脚本练习
  2. (转)Ubuntu samba配置服务文件包
  3. 结合仓库设计MVC控制器
  4. jquery 设置元素内容html(),text(),val()
  5. HDU 4884 TIANKENG’s rice shop (模拟)
  6. HTTPConnection与HTTPClient的区别
  7. Articulate Studio课间制作工具
  8. shell环境
  9. ural 1348 Goat in the Garden 2
  10. c++继承构造子类调用父类构造函数的问题及关于容器指针的问题及当容器里储存指针时,记得要手动释放
  11. RMAN多种备份脚本分享
  12. CentOS 7 yum搭建 LAMP
  13. 201521123001《Java程序设计》第5周学习总结
  14. 笨办法33while循环
  15. hdfs数据采集场景示意图
  16. 如何恢复Eclipse中被误删除的文件
  17. 【解决】Can&#39;t find default configuration &quot;arch/x86/configs/xx_defconfig&quot;!
  18. Hyper-V 连网备忘
  19. android -------- ConstraintLayout介绍 (一)
  20. SpringBoot进阶之web进阶

热门文章

  1. 原来在UNITY中使用system.io下的所有函数都可以用相对路径 : Assets/xx
  2. Tomcat GC参数详解
  3. scrapy基础笔记
  4. python简单的函数定义和用法实例
  5. Repository模式--采用EF Fluent API使用EntityTypeConfiguration分文件配置Model映射关系
  6. 软件体系结构-分层、代理、MVC、管道与过滤器
  7. Mac009--Axure RP安装
  8. 基于dvwa环境下级别为low的SQL手工注入教程
  9. Js数据去重复,时间更换格式,cookie,localStorage和sessionStorage的使用等通用方法
  10. http响应代码解释