随笔分类 - 字符串
摘要:Problem 2088 最长队名 Problem Description Jack所在的班级决定组团报名参加FZU校赛。为了体现班级的团结和睦,班长决定用班级所有人的名字连起来组成一个史上最长最醒目的队名。 因为听说在分数相同的情况下,队名字典序小的会排在更前面,班长还希望连成的史上最长队名拥有最
阅读全文
摘要:Text Reverse Problem Description Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should re
阅读全文
摘要:Digital Roots Problem Description The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a si
阅读全文
摘要:Repetitions of Substrings Description The “repetitions” of a string S(whose length is n) is a maximum number “k” such that: 1) k is a factor of n 2) S
阅读全文
摘要:Hamming Distance Description Have you ever heard of the Hamming distance. It is the number of positions for which the corresponding digits differ. You
阅读全文
摘要:Time Limit: 1 Sec Memory Limit: 128 MB Description 有一个长度为n的字符串(只包含小写字母),操作m次,每次操作交换两个字母,输出最终字符串。 Input 多组输入,每组第一行为n,m表示字符串长度和操作数,1<n,m<=100000第二行为长度n的
阅读全文
摘要:Time Limit: 1 Sec Memory Limit: 128 MB Description 你的任务是编写一个程序实现简单的字符宽度编码方法。规则如下:将任何2~9个相同字符的序列编码成2个字符:第1个字符是序列的长度,用数字字符2~9表示,第2个字符为这一串相同字符序列中的字符。超过9个
阅读全文
摘要:题目链接 题解:将每个单词倒置,可以用char数组,然后用空格分隔,这里用的是string和stringstream。 #include <cstdio> #include <iostream> #include <string> #include <sstream> #include <cstri
阅读全文

浙公网安备 33010602011771号