B. ZgukistringZ】的更多相关文章

B. ZgukistringZ Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/problem/B Description Professor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one. GukiZ has strings a,…
题目传送门 /* 题意:任意排列第一个字符串,使得有最多的不覆盖a/b字符串出现 字符串处理/贪心:暴力找到最大能不覆盖的a字符串,然后在b字符串中动态得出最优解 恶心死我了,我最初想输出最多的a,再最多的b,然而并不能保证是最多的:( */ #include <cstdio> #include <cstring> #include <string> #include <iostream> #include <algorithm> #includ…
题目链接:http://codeforces.com/contest/551/problem/B 题目大意:给你三个字符串,s1,s2,s3.  s1任意两个字符串之间可以互相交换. 问,在s1中s2和s3在不重叠的情况下,两个字符串出现的最多次数之和的时候为多少,然后将排完序的字符串输出. 思路:一开始打算用桶排做,将每个字符串中的字符出现的次数记录下来,然后查看每个字符串在s1中出现的次数最多为多少,然后按照最大的输出.结果交上去错了,后来才发现是求s1和s2出现的次数之和的最大值,有可能有…
题意与分析(CodeForces 551B) 这他妈哪里是日常训练,这是日常弟中弟. 题意是这样的,给出一个字符串A,再给出两个字符串B,C,求A中任意量字符交换后(不限制次数)能够得到的使B,C作为子串不重叠且出现次数最多的串. 看起来很简单对吧,做法也很简单,先排序字符,然后枚举合法的B串能在A串中出现的次数,看能有几个C串,然后求个最优解就行了.是不是很简单?然后WA了十几发,各种捉bug,太杀妈了. 这份代码看起来贼简单,这是我写的第三版了.... 这种字符串题目太苦手了QAQ 代码 #…
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Professor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one. GukiZ has strings a, b, and c. H…
Professor GukiZ doesn't accept string as they are. He likes to swap some letters in string to obtain a new one. GukiZ has strings a, b, and c. He wants to obtain string k by swapping some letters in a, so that k should contain as many non-overlapping…
A. GukiZ and Contest time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Professor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepares. Now,…