【打渔】CodeForce Round 197 Div.2 Problem_A
来源:互联网 发布:asp.net 微信支付源码 编辑:程序博客网 时间:2024/05/21 15:18
来源:点击打开链接
划了一周的水了。。做一些比赛找找状态吧,要跪的节奏啊。
刚开始看的时候没有发现只有1,2,3三种字符。代码流畅度没有以前高了,做这种水题居然还要想半天怎么放加号。。
#include <iostream>#include <string>#include <cstring>#include <algorithm>using namespace std;int saver[200];int main(){ string tar,tmp; int count1=0,count2=0,count3=0; cin>>tar; memset(saver,0,sizeof(saver)); for(int i=0;i<tar.length();i++) { if(tar[i]=='1') count1++; if(tar[i]=='2') count2++; if(tar[i]=='3') count3++; } int p=count1+count2+count3-1; int q=0; for(int i=0;i<count1;i++) { cout<<1; if(q!=p) { cout<<"+"; q++; } } for(int j=0;j<count2;j++) { cout<<2; if(q!=p) { cout<<"+"; q++; } } for(int k=0;k<count3;k++) { cout<<3; if(q!=p) { cout<<"+"; q++; } } cout<<endl; return 0;}
- 【打渔】CodeForce Round 197 Div.2 Problem_A
- CodeForce Round #186 Div.2
- codeforce round 247 div.2 B
- codeforce Round #379 (Div. 2)C(贪心)
- 【codeforce】Round #402 Div.2 C
- Codeforce Round #422(Div 2) A
- Codeforce Round #422(Div 2) B
- Codeforce Round #384(Div 2)A
- Codeforce Round #384 (Div 2) C
- 【CodeForce】Codeforces Round #140 (Div. 2) A B C
- 【CodeForce】Codeforces Round #141 (Div. 2) B. Two Tables
- 【CodeForce】Codeforces Round #142 (Div. 2) A B C
- codeforce CROC-MBTU 2012, Final Round (Online version, Div. 2)
- Codeforce Round#350(Div. 2) 670B Game of Robots
- Codeforce Round #382(Div 1) B
- Codeforce Round #382 (div 1) A
- Codeforce Round #383(Div 1) A
- codeforce 157 div 2
- E2 (b)
- python项目目录管理
- Android SDK Manager无法更新的解决
- JavaScript中的匿名函数及函数的闭包
- HDU4347 The Closest M Points
- 【打渔】CodeForce Round 197 Div.2 Problem_A
- 浅谈百度360T盘大战
- Exercises 3.3
- JavaScript跨域总结与解决办法
- CSS3 圆角(border-radius)
- hdu1874畅通工程续
- JS操作iframe
- POJ3256-DFS
- Smarty模板变量操作符总结