当前位置: 首页 > news >正文

[hdu 1711] Number Sequence [kmp]

Number Sequence
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 20398 Accepted Submission(s): 8741

Problem Description
Given two sequences of numbers : a[1], a[2], …… , a[N], and b[1], b[2], …… , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2], …… , a[K + M - 1] = b[M]. If there are more than one K exist, output the smallest one.

Input
The first line of input is a number T which indicate the number of cases. Each case contains three lines. The first line is two numbers N and M (1 <= M <= 10000, 1 <= N <= 1000000). The second line contains N integers which indicate a[1], a[2], …… , a[N]. The third line contains M integers which indicate b[1], b[2], …… , b[M]. All integers are in the range of [-1000000, 1000000].

Output
For each tes

相关文章:

  • [poj 3461]Oulipo[kmp]
  • strcpy和strncpy用法和区别
  • [POJ 2406]Power Strings[KMP]
  • markdown语法
  • BestCoder 2nd Anniversary #1001-oracle
  • [NOIP 2015] Day.1 T1 神奇的幻方 [模拟]
  • [NOIP 2015]Day.1 T2 信息传递 【最小环】
  • 查找有向图中的环
  • 求无向图最小环算法-floyd
  • [hdu 3746] Cyclic Nacklace [kmp]
  • [poj 2001]Shortest Prefixes [Trie]
  • Trie - 字典树 模板
  • [hdu 1247]Hat’s Words [Trie 图]
  • Trie树专题 [转]
  • using声明、using指示及其作用域详解
  • Android开发 - 掌握ConstraintLayout(四)创建基本约束
  • bootstrap创建登录注册页面
  • C++入门教程(10):for 语句
  • Docker 1.12实践:Docker Service、Stack与分布式应用捆绑包
  • Docker下部署自己的LNMP工作环境
  • java8 Stream Pipelines 浅析
  • Java多态
  • k8s如何管理Pod
  • mongo索引构建
  • Spring Cloud Feign的两种使用姿势
  • Spring-boot 启动时碰到的错误
  • 简单基于spring的redis配置(单机和集群模式)
  • 可能是历史上最全的CC0版权可以免费商用的图片网站
  • 面试题:给你个id,去拿到name,多叉树遍历
  • 面试遇到的一些题
  • 七牛云 DV OV EV SSL 证书上线,限时折扣低至 6.75 折!
  • 如何使用 OAuth 2.0 将 LinkedIn 集成入 iOS 应用
  • 如何优雅地使用 Sublime Text
  • 如何抓住下一波零售风口?看RPA玩转零售自动化
  • 三栏布局总结
  • 小程序button引导用户授权
  • 说说我为什么看好Spring Cloud Alibaba
  • #Spring-boot高级
  • $.each()与$(selector).each()
  • (02)Hive SQL编译成MapReduce任务的过程
  • (1) caustics\
  • (20050108)又读《平凡的世界》
  • (附源码)spring boot基于Java的电影院售票与管理系统毕业设计 011449
  • (一)Mocha源码阅读: 项目结构及命令行启动
  • (已解决)报错:Could not load the Qt platform plugin “xcb“
  • (正则)提取页面里的img标签
  • (转)IIS6 ASP 0251超过响应缓冲区限制错误的解决方法
  • .bat批处理(六):替换字符串中匹配的子串
  • .dat文件写入byte类型数组_用Python从Abaqus导出txt、dat数据
  • .NET “底层”异步编程模式——异步编程模型(Asynchronous Programming Model,APM)...
  • .NET Core WebAPI中使用Log4net 日志级别分类并记录到数据库
  • .net refrector
  • .netcore 如何获取系统中所有session_ASP.NET Core如何解决分布式Session一致性问题
  • /etc/skel 目录作用
  • @Autowired注解的实现原理