上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as: h d e l l 阅读全文
posted @ 2018-10-28 20:15 wyboooo 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2018-10-28 19:51 wyboooo 阅读(115) 评论(0) 推荐(0) 编辑
摘要: The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the s 阅读全文
posted @ 2018-10-28 19:37 wyboooo 阅读(193) 评论(1) 推荐(1) 编辑
摘要: Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 35044 Accepted: 11628 Description A musical melody is represented as a sequen 阅读全文
posted @ 2018-10-28 16:03 wyboooo 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he ca 阅读全文
posted @ 2018-10-28 14:45 wyboooo 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one strin 阅读全文
posted @ 2018-10-28 13:28 wyboooo 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目描述 如果一个字符串可以被拆分为AABBAABB的形式,其中 A和 B是任意非空字符串,则我们称该字符串的这种拆分是优秀的。 例如,对于字符串aabaabaaaabaabaa,如果令 A=aabA=aab,B=aB=a,我们就找到了这个字符串拆分成 AABBAABB的一种方式。 一个字符串可能没 阅读全文
posted @ 2018-10-27 11:54 wyboooo 阅读(319) 评论(1) 推荐(2) 编辑
摘要: 居然真的遇上了这种蔡队题。瑟瑟发抖。 题目背景 阿狸喜欢收藏各种稀奇古怪的东西,最近他淘到一台老式的打字机。 题目描述 打字机上只有28个按键,分别印有26个小写英文字母和'B'、'P'两个字母。经阿狸研究发现,这个打字机是这样工作的: ·输入小写字母,打字机的一个凹槽中会加入这个字母(这个字母加在 阅读全文
posted @ 2018-10-26 16:59 wyboooo 阅读(498) 评论(0) 推荐(0) 编辑
摘要: 题目背景 这是一道模板题。 题目描述 读入一个长度为 nn 的由大小写英文字母或数字组成的字符串,请把这个字符串的所有非空后缀按字典序从小到大排序,然后按顺序输出后缀的第一个字符在原串中的位置。位置编号为 11 到 nn。 输入输出格式 输入格式: 一行一个长度为 nn 的仅包含大小写英文字母或数字 阅读全文
posted @ 2018-10-26 14:54 wyboooo 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 后缀树: 字符串匹配算法一般都分为两个步骤,一预处理,二匹配。 KMP和AC自动机都是对模式串进行预处理,后缀树和后缀数组则是对文本串进行预处理。 后缀树的性质: 存储所有 n(n-1)/2 个后缀需要 O(n) 的空间,n 为的文本(Text)的长度; 构建后缀树需要 O(dn) 的时间,d 为字 阅读全文
posted @ 2018-10-26 14:15 wyboooo 阅读(3997) 评论(0) 推荐(2) 编辑
摘要: 题目描述 二进制病毒审查委员会最近发现了如下的规律:某些确定的二进制串是病毒的代码。如果某段代码中不存在任何一段病毒代码,那么我们就称这段代码是安全的。现在委员会已经找出了所有的病毒代码段,试问,是否存在一个无限长的安全的二进制代码。 示例: 例如如果{011, 11, 00000}为病毒代码段,那 阅读全文
posted @ 2018-10-25 20:26 wyboooo 阅读(173) 评论(0) 推荐(0) 编辑
摘要: AC自动机就是用来处理在一个字符串中找多个模式串的问题。 假设有N个模式串,平均长度为L;文章长度为M。 建立Trie树:O(N*L) 建立fail指针:O(N*L) 模式匹配:O(M*L) 所以,总时间复杂度为:O( (N+M)*L )。 典型例题见洛谷上这道模板题 https://www.luo 阅读全文
posted @ 2018-10-25 19:08 wyboooo 阅读(185) 评论(0) 推荐(0) 编辑
摘要: P1603 斯诺登密码 https://www.luogu.org/problemnew/show/P1603 思路:题目里写的非正规是真的坑啊,我还以为是非正规输入输入这些是不能算数字的,其实是要算的,而且 another 是什么鬼居然算1. 1 #include <iostream> 2 #in 阅读全文
posted @ 2018-10-24 22:23 wyboooo 阅读(254) 评论(0) 推荐(0) 编辑
摘要: P1055 ISBN号码 https://www.luogu.org/problemnew/show/P1055 题意:一个ISBN号码形如x-xxx-xxxxx-c,将ISBN号码中的前九个数字按顺序分别乘上1,2,3,...,9之后相加取模11得到c。问给出的c是否合法,若不合法输出合法的ISB 阅读全文
posted @ 2018-10-23 22:19 wyboooo 阅读(181) 评论(0) 推荐(0) 编辑
摘要: Milking Grid Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 10084 Accepted: 4371 Description Every morning when they are milked, the Farme 阅读全文
posted @ 2018-10-23 20:01 wyboooo 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Phone List Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 34805 Accepted: 9980 Description Given a list of phone numbers, determine if it 阅读全文
posted @ 2018-10-23 18:07 wyboooo 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1809 匹配统计 0x18「基本数据结构」练习 描述 阿轩在纸上写了两个字符串,分别记为A和B。利用在数据结构与算法课上学到的知识,他很容易地求出了“字符串A从任意位置开始的后缀子串”与“字符串B”匹配的长度。 不过阿轩是一个勤学好问的同学,他向你提出了Q个问题:在每个问题中,他给定你一个整数x, 阅读全文
posted @ 2018-10-22 12:58 wyboooo 阅读(798) 评论(0) 推荐(0) 编辑
摘要: A golden plate http://codeforces.com/contest/1072/problem/A 题意:给一个n*m的格子,从最外层往里涂色,每次尽量涂最外面的那一圈,两圈涂色之间要间隔一格。问最多涂多少颜色。 思路:最外面一圈是2*n + 2(m - 2),然后行和列都减4就 阅读全文
posted @ 2018-10-21 21:28 wyboooo 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 1807 Necklace 0x18「基本数据结构」练习 背景 有一天,袁☆同学绵了一条价值连城宝石项链,但是,一个严重的问题是,他竟然忘记了项链的主人是谁!在得知此事后,很多人向☆同学发来了很多邮件,都说项链是自己的,要求他归还(显然其中最多只有一个人说了真话)。 ☆同学要求每个人都写了一段关于自 阅读全文
posted @ 2018-10-21 15:31 wyboooo 阅读(337) 评论(0) 推荐(0) 编辑
摘要: The xor-longest Path Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 10038 Accepted: 2040 Description In an edge-weighted tree, the xor-len 阅读全文
posted @ 2018-10-21 11:25 wyboooo 阅读(171) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页