摘要: 9.16 A - 统计难题(字典树模板题) Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们 阅读全文
posted @ 2019-09-23 10:37 蓉~ 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 9.7 Crazy Search(字符串哈希) Many people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime 阅读全文
posted @ 2019-09-11 20:17 蓉~ 阅读(263) 评论(0) 推荐(0) 编辑
摘要: kmp用于一一匹配问题,如字符串的匹配。 一遇到匹配问题,最初大家想到的就是循环一一对比匹配了,但是那样太慢,这就需要用到kmp了, 它就是很快的,用到最大公共前后缀, 如ABCDABC这个串,我们匹配ABCDABTBCDABC这个长串,当匹配到第7个字符T的时候就不匹配了,用kmp我们就不用直接移 阅读全文
posted @ 2019-09-10 17:34 蓉~ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Email address in Berland is a string of the form A@B, where A and B are arbitrary strings consisting of small Latin letters. Bob is a system administr 阅读全文
posted @ 2019-07-25 20:47 蓉~ 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 线段树的讲解https://www.bilibili.com/video/av47331849?from=search&seid=16724415639232651392 A - 敌兵布阵 题目: C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国 阅读全文
posted @ 2019-07-24 19:54 蓉~ 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Lose it! You are given an array aa consisting of nn integers. Each aiai is one of the six following numbers: 4,8,15,16,23,424,8,15,16,23,42 . Your tas 阅读全文
posted @ 2019-07-24 09:39 蓉~ 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Though Rujia Liu usually sets hard problems for contests (for example, regional contests likeXi’an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ contes 阅读全文
posted @ 2019-07-19 17:12 蓉~ 阅读(274) 评论(0) 推荐(0) 编辑
摘要: map Most crossword puzzle fans are used to anagrams — groups of words with the same letters in different orders — for example OPTS, SPOT, STOP, POTS a 阅读全文
posted @ 2019-07-19 11:03 蓉~ 阅读(389) 评论(0) 推荐(0) 编辑
摘要: One cold winter evening Alice and her older brother Bob was sitting at home near the fireplace and giving each other interesting problems to solve. Wh 阅读全文
posted @ 2019-06-13 09:34 蓉~ 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。 现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距离。 Input本题目包含多组数据,请 阅读全文
posted @ 2019-06-13 09:31 蓉~ 阅读(105) 评论(0) 推荐(0) 编辑