
Codeforces Round
文章平均质量分 78
cyendra
Azarath Metrion Zinthos
展开
-
Codeforces Round #191 (Div. 2) 解题报告
------------A. Flipping Game有n个整数a1, a2, ..., an,每个整数只可能为0或1。选择一个区间[i, j](i目标是求一次翻转后1的最大数目。----将0变为1,将1变为-1,1次翻转后1的最大数目=原序列中1的数目+最大连续子序列和。问题转化为求最大连续子序列和,dp解决。注意一定要翻转一次,这是个坑。#includ原创 2013-07-08 18:20:47 · 1738 阅读 · 6 评论 -
Codeforces Round #101 (Div. 2)
--------------A. Amusing Joke--前两行的字母恰好组成最后一行--#include #include using namespace std;char a[1111];int ch[26]={0};int main(){ cin>>a; for (int i=0;a[i];i++){ ch[a[i]原创 2013-09-04 16:13:47 · 754 阅读 · 0 评论 -
Codeforces Round #102 (Div. 2) //缺E
-----------------------A. Help Vasilisa the Wise 2---暴力枚举---#include using namespace std;int r1,r2,c1,c2,d1,d2;int a[2][2];bool solve(){ if (a[0][0]+a[0][1]!=r1) return false;原创 2013-09-04 19:50:37 · 792 阅读 · 0 评论 -
Codeforces Round #106 (Div. 2) //缺E
-------------------------A. Business trip---至少浇几个月水能使花的长度超过k。---#include #include using namespace std;int main(){ int k; int a[13]; int sum=0; int ans=-1; cin>>k;原创 2013-09-09 20:27:25 · 806 阅读 · 0 评论 -
Codeforces Round #103 (Div. 2) //缺E
------------------A. Arrival of the General---可以交换相邻两个数字。求将最大值移到最左边,最小值移到最右边所用的最小步数。---#include using namespace std;int main(){ int n; int a[111]; cin>>n; int mx=0,m原创 2013-09-09 12:43:16 · 829 阅读 · 0 评论 -
Codeforces Round #104 (Div. 2) //缺E
----------------A. Lucky Ticket---判断给出的数字是不是两半和相等的幸运数字。---#include using namespace std;int main(){ int n; char s[111]; cin>>n>>s; bool ok=true; for (int i=0;i<n;i+原创 2013-09-08 21:38:04 · 741 阅读 · 0 评论 -
Codeforces Round #105 (Div. 2) //缺E
--------------A. Insomnia cure---求1~n中能被klmn整除的数的个数。---#include using namespace std;int main(){ int k,l,m,n,d; cin>>k>>l>>m>>n>>d; int sum=0; for (int i=1;i<=d;i++){原创 2013-09-08 21:52:17 · 792 阅读 · 0 评论 -
Codeforces Round #197 (Div. 2)
-----------------A. Helpful Maths----将一个由+和123组成的式子从小到大排序...----#include #include #include #include using namespace std;const int maxn=1111;char s[maxn];vectorvc;int main(){原创 2013-08-29 18:52:47 · 685 阅读 · 0 评论 -
Codeforces Round #188 (Div. 2) 解题报告 //缺E
----------------------------A. Even Odds将1到n中的奇数排到前面偶数排到后面,问第k个数是多少。----嗯。。。math#include #include #include using namespace std;typedef long long LL;LL n,d,k,m;int main(){ cin原创 2013-07-16 11:35:22 · 851 阅读 · 0 评论 -
Codeforces Round #192 (Div. 2) 解题报告 //缺E
---------------A. CakeminatorrXc的蛋糕中有一些邪恶的草莓,如果某一行或某一列没有草莓我们可以吃掉这一排。问最多能吃多少蛋糕。----直接暴力寻找空行空列即可。#include #include using namespace std;const int maxn=21;char s[maxn][maxn];bool v[m原创 2013-07-21 22:34:11 · 708 阅读 · 0 评论 -
Codeforces Round #190 (Div. 2) 解题报告
-----------------A. Ciel and Dancingn个男孩和m个女孩配对跳舞,每首歌有一对男女跳舞,要求配对男孩和女孩中至少有一个没有跳过舞。求最多的能放的歌曲数并输出配对方案。分析可知最多能放n+m-1首歌曲。----贪心,男孩1和所有的女孩跳舞。女孩1和所有的男孩跳舞。除去男孩1和女孩1重复的情况#include #inclu原创 2013-06-29 21:13:33 · 1204 阅读 · 2 评论 -
Codeforces Round #189 (Div. 2) 解题报告
----------------A. Magic Numbers一个神奇的数字是由1、14、144连接而成的,判断一个数字是不是神奇数字。----①没有连续3个以上的4。②首位不能为4。数据范围太大,最好按字符读入。#include #include #include using namespace std;char c;int n,num;bool原创 2013-07-13 20:17:30 · 1187 阅读 · 0 评论 -
Codeforces Round #199 (Div. 2)
-----------------------------A. Xenia and Divisors---将n个数3个一组分成满足条件的n/3组。由于数字最多是7,所以只有124、126、136三种分组方式。先分出所有的136,再分出124,126。若所有数字都用光则分组成功。---#include using namespace std;int n;i原创 2013-09-13 11:45:50 · 792 阅读 · 0 评论