摘要: 由于题目数据量比较小,故可以开辟一个数组存储每个index出现的次数然后遍历即可string canItBeDone(int k, vector A){ vector cnt(52,0); int n = A.size(); for(int i = 0 ; i A) { ... 阅读全文
posted @ 2014-06-20 21:30 OpenSoucre 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 关于证明可以参考题解http://codeforces.com/blog/entry/12739就是将概率从大到小排序然后,然后从大到小计算概率#include #include #include #include #include #include using namespace std;int ... 阅读全文
posted @ 2014-06-20 20:44 OpenSoucre 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 本题要考虑字符串本身就存在tandem,如测试用例aaaaaaaaabbb3输出结果应该是8而不是6,因为字符串本身的tanderm时最长的故要考虑字符串本身的最大的tanderm和添加k个字符后最大的tanderm#include #include #include #include #inclu... 阅读全文
posted @ 2014-06-20 17:15 OpenSoucre 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 题目很简单,只需要注意带空格的输入用getline即可#include #include #include #include #include using namespace std;int main(){ string str; getline(cin,str); set a; ... 阅读全文
posted @ 2014-06-20 17:11 OpenSoucre 阅读(135) 评论(0) 推荐(0) 编辑