
ACM-字符串
文章平均质量分 64
路小白_zZ
这个作者很懒,什么都没留下…
展开
-
uva 10361(字符串)
题目:“Oh God”, Lara Croft exclaims, “it’s one of these dumb riddles again!”In Tomb Raider XIV, Lara is, as ever, gunning her way through ancient Egyptian pyramids, prehistoric caves and medival hallwa原创 2014-05-12 00:55:39 · 922 阅读 · 0 评论 -
uva 10815(字符串)
题意:题解:原创 2014-08-11 21:35:10 · 1133 阅读 · 0 评论 -
uva 620(字符串)
题意:题解:原创 2014-10-28 21:09:58 · 1013 阅读 · 0 评论 -
uvalive 4324
题意:有一个图上全是'.',现在会放一些矩形上去,每个矩形都由'A'~'Z'组成,且不会重复,一些矩形会被另一些矩形覆盖,问位于最上方的不被覆盖的矩形是哪些,输出组成字母。按字典序输出,每个矩形长宽不少于3。题解:直接暴力,比较矩形的对应的长和宽是否相等,需要注意最上方矩形内部一定都是'.'。#include const int N = 105;char m[N][N];in原创 2015-03-25 16:56:09 · 799 阅读 · 0 评论 -
hdu 5007
题意:有iPhone iPad iPod Apple这些词出现就输出MAI MAI MAI! 有Sony输出。。。题解:水题。#include #include #include using namespace std;string str; int main() { while (getline(cin, str)) { int len = str.length()原创 2015-03-16 23:59:48 · 603 阅读 · 0 评论 -
zoj 3810(找规律)
题意:有green red yellow blue四种颜色,把一个N*N的矩阵划分为N个区域,颜色相同且紧邻认为是同一个区域,构造一个N*N的矩阵,用GRYB表示。题解:构造矩形,找到构造规律就好了。。。可是好难QAQ。1和6特殊处理,2、3、4无解,剩下的用规律构造之。#include #include const int N = 105;char s[5] = "BGRY原创 2015-03-08 17:27:19 · 671 阅读 · 0 评论 -
hdu 5202
题意:有个不完整的字符串,需要在字符串的?处填字母使字符串不会成为回文串且字典序最小,输出完整字符串。题解:思路是先把所有?替换成a,检验发现不是回文串就输出,如果只有一个?且位置在中间就输出'QwQ',否则就把最后一个?换成b,如果最后一个?在中间,替换倒数第二个?为b,坑。。。#include #include const int N = 1005;char str[N];in原创 2015-04-12 00:07:28 · 673 阅读 · 0 评论 -
hdu 4054
题意:读入一行字符串,16个字符输出一行内容,按格式输出16个字符的ascii码,不足16个字符补上空格,每行的开头是第k个字符的首地址,输出16进制数,每行最后要输出原字符,大写字母换为小写,小写换为大写。 题解:处理有点麻烦的字符串水题。#include <stdio.h>#include <string.h>const int N = 5000;char str[N];int main原创 2015-05-10 23:12:11 · 827 阅读 · 0 评论 -
acdream 1125
题意:有一个字符串s,输出一个不同于s的所有子串的最小字典序串。 题解:因为字典序要最少,直接输出s最长连续A的数量加一个A。#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;const int N = 105;char str[N];int main() { int t;原创 2015-05-13 23:20:03 · 460 阅读 · 0 评论 -
uva 10562(dfs)
题解:这道题非常让我想xxxxxx, 开始时想了很多情况原创 2014-07-30 21:16:35 · 674 阅读 · 0 评论 -
uva 644(字符串)
题目:An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in b原创 2014-07-08 15:10:25 · 717 阅读 · 0 评论 -
uva 1368(字符串)
Figure 1.DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as shown in Figu原创 2014-05-12 00:33:33 · 806 阅读 · 0 评论 -
uva 327(字符串)
题解:模拟+栈(存放运算符)。#include #include #include #include #include using namespace std;const int N = 30;int flag[N], now[N], value;void init() { value = 0; memset(flag, 0, sizeof(flag));原创 2014-07-25 18:34:51 · 1007 阅读 · 0 评论 -
uva 537(字符串)
题目:Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and understand the problem first!So the原创 2014-07-08 10:43:29 · 732 阅读 · 0 评论 -
uva 10115(字符串)
题目:Text-processing tools like awk and sed allow you to automatically perform a sequence of editing operations based on a script. For this problem we consider the specific case in which we want to原创 2014-07-08 10:17:48 · 771 阅读 · 0 评论 -
uva 409(字符串)
题目:原创 2014-07-08 09:59:16 · 779 阅读 · 0 评论 -
uva 10878(字符串)
题目:"Machines take me by surprise with great frequency." Alan TuringYour boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful i原创 2014-07-08 10:13:23 · 805 阅读 · 0 评论 -
uva 401(字符串)
题目:A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA" is a palindrome because it is the same when the string is rea原创 2014-07-08 10:32:16 · 1111 阅读 · 0 评论 -
uva 10010(字符串)
题目:Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of letters in the grid. A w原创 2014-07-08 09:46:29 · 756 阅读 · 0 评论 -
Codeforces 570C
题意:一个字符串包含小写字母和’.’,化简是把两个连续的’.’化为一个’.’,现在操作是 a b,把位置a上的字符替换成b后,问多少步才能化简结束。 题解:先把初始字符串需要的步数计算出来,然后分情况加或减或不变。#include <cstdio>#include <cstring>#include <algorithm>using namespace std;const int N =原创 2015-08-15 00:07:39 · 840 阅读 · 0 评论