随笔分类 -  字符串

摘要:题目描述 Bessie's cruel second grade teacher has assigned a list of N (1 <= N <= 100) positive integers I (1 <= I <= 10^60) for which Bessie must determin 阅读全文
posted @ 2017-12-04 01:21 Roni_i 阅读(400) 评论(0) 推荐(0)
摘要:题目背景(https://www.luogu.org/problemnew/show/P3742) umi 找到了一个神秘的函数 f。 题目描述 这个函数接受两个字符串 s1,s2。这些字符串只能由小写字母组成,并且具有相同的长度。这个函数的输出是另一个长度与 s1,s2 相同的字符串 g。g 的第 阅读全文
posted @ 2017-12-03 23:19 Roni_i 阅读(283) 评论(0) 推荐(0)
摘要:题目描述 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数。 写一个程序来找出范围[a,b](5 <= a < b <= 100,000,000)( 一亿)间的所有回文质数; 输入输出格式 输入格式: 第 1 行: 二个整数 a 和 b . 输出格式: 阅读全文
posted @ 2017-12-03 15:44 Roni_i 阅读(379) 评论(0) 推荐(0)
摘要:B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output B. Chtholly's requ 阅读全文
posted @ 2017-12-02 23:25 Roni_i 阅读(633) 评论(0) 推荐(0)
摘要:A. Scarborough Fair time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Scarborough Fair 阅读全文
posted @ 2017-12-02 23:11 Roni_i 阅读(189) 评论(0) 推荐(0)
摘要:A. Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Two Substrings time 阅读全文
posted @ 2017-12-02 12:30 Roni_i 阅读(215) 评论(0) 推荐(0)
摘要:A. Bus to Udayland time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Bus to Udayland ti 阅读全文
posted @ 2017-12-02 10:00 Roni_i 阅读(207) 评论(0) 推荐(0)
摘要:时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld 题目描述 给出一个数x,求x的所有位数的和。 输入描述: 第1行输入组数T,代表有T组数据。 第2-T+1行,每行输入一个数x。 输入数据保证:0≤x≤1020 阅读全文
posted @ 2017-11-26 19:03 Roni_i 阅读(138) 评论(0) 推荐(0)
摘要:题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。 任务描述: 给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列 阅读全文
posted @ 2017-11-14 23:25 Roni_i 阅读(214) 评论(0) 推荐(0)
摘要:Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, 阅读全文
posted @ 2017-11-14 22:28 Roni_i 阅读(291) 评论(0) 推荐(0)
摘要:D. Restoration of string time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output D. Restoration 阅读全文
posted @ 2017-11-14 10:40 Roni_i 阅读(323) 评论(0) 推荐(0)
摘要:1095 Anigram单词 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 收藏 关注 1095 Anigram单词 基准时间限制:1 秒 空间限制:131072 KB 分值: 10 难度:2级算法题 1095 Anigram单词 基准时间限制:1 秒 空间限制 阅读全文
posted @ 2017-11-04 09:48 Roni_i 阅读(236) 评论(0) 推荐(0)
摘要:1182 完美字符串 题目来源: Facebook Hacker Cup选拔 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 收藏 关注 1182 完美字符串 题目来源: Facebook Hacker Cup选拔 基准时间限制:1 秒 空间限制:131072 KB 阅读全文
posted @ 2017-10-31 20:29 Roni_i 阅读(220) 评论(0) 推荐(0)
摘要:题目描述 写一个程序从输入文件中去读取四行大写字母(全都是大写的,每行不超过72个字符),然后用柱状图输出每个字符在输入文件中出现的次数。严格地按照输出样例来安排你的输出格式。 输入输出格式 输入格式: 四行字符,由大写字母组成,每行不超过72个字符 输出格式: 由若干行组成,前几行由空格和星号组成 阅读全文
posted @ 2017-10-25 18:09 Roni_i 阅读(304) 评论(0) 推荐(0)
摘要:题目描述 一般的文本编辑器都有查找单词的功能,该功能可以快速定位特定单词在文章中的位置,有的还能统计出特定单词在文章中出现的次数。 现在,请你编程实现这一功能,具体要求是:给定一个单词,请你输出它在给定的文章中出现的次数和第一次出现的位置。注意:匹配单词时,不区分大小写,但要求完全匹配,即给定单词必 阅读全文
posted @ 2017-10-25 00:01 Roni_i 阅读(341) 评论(0) 推荐(0)
摘要:A. Alex and broken contest time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Alex and b 阅读全文
posted @ 2017-10-24 11:52 Roni_i 阅读(438) 评论(0) 推荐(0)
摘要:题目描述 设有n个正整数(n≤20),将它们联接成一排,组成一个最大的多位整数。 例如:n=3时,3个整数13,312,343联接成的最大整数为:34331213 又如:n=4时,4个整数7,13,4,246联接成的最大整数为:7424613 输入输出格式 输入格式: 第一行,一个正整数n。 第二行 阅读全文
posted @ 2017-10-11 11:21 Roni_i 阅读(256) 评论(0) 推荐(0)
摘要:A. Bark to Unlock time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A. Bark to Unlock time 阅读全文
posted @ 2017-10-05 20:48 Roni_i 阅读(400) 评论(0) 推荐(0)
摘要:1183 编辑距离 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 编辑距离,又称Levenshtein距离(也叫做Edit Distance),是指两个字串之间,由一个转成另一个所需的最少编辑操作次数。许可的编辑操作包括将一个字符替换成另一个字符,插入一个 阅读全文
posted @ 2017-10-03 10:46 Roni_i 阅读(289) 评论(0) 推荐(0)
摘要:Problem Description Little Ruins is a studious boy, recently he learned the four operations! Now he want to use four operations to generate a number, 阅读全文
posted @ 2017-09-11 15:50 Roni_i 阅读(208) 评论(0) 推荐(0)