2013年1月18日
摘要: #include<stdio.h>int main(){ int n,m,i; freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); scanf("%d %d",&n,&m); if(n>=m) { for(i=1;i<=m;i++) printf("BG"); for(i=1;i<=n-m;i++) printf("B"); } e 阅读全文
posted @ 2013-01-18 23:13 海暗 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int n,i,j=1,m,a[101]={0},t=0,q=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&m); if(m<0)t++; if(t>=3)t=1,a[j++]=q,q=1; else q++; } a[j]=q;printf("%d\n",j); for(i=1;i<=j;i++) printf("%d ",a[i]); return 阅读全文
posted @ 2013-01-18 23:11 海暗 阅读(350) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int n,i,l,r,l1=0,r1=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d %d",&l,&r); if(l==1)l1++; if(r==1)r1++; } if(n-l1<l1)l1=n-l1; if(n-r1<r1)l1+=n-r1; else l1+=r1; printf("%d",l1); return 0;}http://codeforces.com/ 阅读全文
posted @ 2013-01-18 23:09 海暗 阅读(297) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>int main(){ int n,i; scanf("%d",&n); if(n<=2){printf("-1");return 0;} for(;n>0;n--)printf("%d ",n);return 0;}http://codeforces.com/contest/246/problem/A 阅读全文
posted @ 2013-01-18 23:07 海暗 阅读(144) 评论(0) 推荐(0) 编辑