题目描述:
读入一个字符串,字符串中包含ZOJ三个字符,个数不一定相等,按ZOJ的顺序输出,当某个字符用完时,剩下的仍然按照ZOJ的顺序输出。
输入:
题目包含多组用例,每组用例占一行,包含ZOJ三个字符,当输入“E”时表示输入结束。
1
输出:
对于每组输入,请输出一行,表示按照要求处理后的字符串。
具体可见样例。
样例输入:
ZZOOOJJJ
ZZZZOO...
分类:
其他好文 时间:
2014-12-22 11:15:31
阅读次数:
145
解题思路:给出两个数列an,bn,其中an,bn中元素的顺序可以任意改变,求an,bn的LCS 因为数列中的元素可以按任意顺序排列,所以只需要求出an,bn中的元素有多少个是相同的即可。反思:一开始以为就是求LCS,一直WA,后来才发现可以按任意顺序排列元素,把相同的元素都排在一起,就是最长的子序列...
分类:
其他好文 时间:
2014-12-22 07:05:55
阅读次数:
253
Ubiquitous Religions
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 25316
Accepted: 12489
Description
There are so many different religions in the world...
分类:
其他好文 时间:
2014-12-19 22:10:23
阅读次数:
274
Kindergarten Election
Time Limit: 2 Seconds Memory Limit: 65536 KB
At the beginning of the semester in kindergarten, the n little kids (indexed from 1 to n, for convenience) in class need...
分类:
其他好文 时间:
2014-12-19 19:08:19
阅读次数:
213
Herd Sums
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 16120
Accepted: 9541
Description
The cows in farmer John's herd are numbered and branded with c...
分类:
其他好文 时间:
2014-12-18 17:07:08
阅读次数:
166
Multiply
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 5179
Accepted: 2773
Description
6*9 = 42" is not true for base 10, but is true for base 13. That...
分类:
其他好文 时间:
2014-12-18 10:25:20
阅读次数:
157
ZOJ问题
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2935 Accepted Submission(s): 889
Problem Description
对给定的字符串(只包含'z','o','j...
分类:
其他好文 时间:
2014-12-18 01:44:32
阅读次数:
223
Dungeon Master Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescription You are trapped in a 3D dungeon and need to find the qu...
分类:
其他好文 时间:
2014-12-17 22:29:20
阅读次数:
224
题目1006:ZOJ问题
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:15725
解决:2647
题目描述:
对给定的字符串(只包含'z','o','j'三种字符),判断他是否能AC。
是否AC的规则如下:
1. zoj能AC;
2. 若字符串形式为xzojx,则也能AC,其中x可以是N个'o' 或者为空;
3. 若a...
分类:
其他好文 时间:
2014-12-17 09:06:59
阅读次数:
137
题目:http://www.lydsy.com:808/JudgeOnline/problem.php?id=1297分析:如果每条边的边权都是1,那么就相当于对邻接矩阵自乘T次(因为写一下递推式子f[i][j]=∑f[i][k]*f[k][j]等价于矩阵乘法的定义)。但是这题每条边的边权是1~9。...
分类:
其他好文 时间:
2014-12-17 00:12:17
阅读次数:
242