Processing math: 100%
祝同学们学习进步,编程快乐!
Problem 2699 --14_D : Multiple String Matching

2699: 14_D : Multiple String Matching

"
Time Limit 3 秒/Second(s) Memory Limit 512 兆字节/Megabyte(s)
提交总数 28 正确数量 21
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL 字符串

String Search 

Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of Pi.

In the first line, a text T is given. In the second line, an integer Q denoting the number of queries is given. 

In the following Q lines, the patterns Pi are given respectively.

For each question, print 1 if the text includes Pi, or print 0 otherwise.
aabaaa
4
aa
ba
bb
xyz
1
1
0
0

Constraints

  • 1 ≤ length of T ≤ 1000000
  • 1 ≤ length of Pi ≤ 1000
  • 1 ≤ Q ≤ 10000
  • The input consists of alphabetical characters and digits


推荐代码 查看2699 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[38 ms] 我要打十个 1101246 2024-05-01 13:36:28
内存最少[2332 KB] RUBY-WOO 431006 2019-05-20 17:28:16
第一AC 刘成健 333906 2018-11-29 22:31:03
第一挑战 刘成健 333906 2018-11-29 22:31:03

赛题来源/所属竞赛 会津大学《挑战数据结构与算法》 挑战数据结构与算法

竞赛编号 竞赛名称 竞赛时间 访问比赛
1865 安科ACM集训队-2025(1)数据结构字符串,基础数据结构专题 2025-04-24 12:00:00 请登录
1818 安科ACM集训队-2024(1)数据结构字符串,基础数据结构专题 2024-05-01 10:00:00 请登录
1645 安科ACM集训队-2021(1)数据结构字符串,基础数据结构专题 2021-05-01 10:00:00 请登录
1332 图灵2019五一高级算法集训营:数据结构字符串、基础数据结构、专题 2019-05-02 09:00:00 请登录
AOJ
祝同学们学习进步,编程快乐!