Mammoth's Genome Decoding,测英语,测手速,测网速
来源:互联网 发布:淘宝运费险能赔付多少 编辑:程序博客网 时间:2024/04/28 17:23
Codeforces Round #387 (Div. 2)B. Mammoth’s Genome Decoding
这道题善良到不行,就是测你会不会手抖而已,
依次分配AGCT就好了,如果符合就输出
#include <iostream>#include <cstdio>#include <cstring>int main(){ int n; char s[300]; scanf("%d",&n); scanf("%s",s); if(n%4!=0){ printf("===\n"); return 0; }else { int a,g,c,t,wen,aver = n/4; a=g=c=t=wen=0; for(int i=0;i<n;++i){ if(s[i]=='A')a++; else if(s[i]=='G')g++; else if(s[i]=='C')c++; else if(s[i]=='T')t++; else wen++; } if(a>aver || g>aver || c>aver || t>aver){ printf("===\n"); return 0; } if(a+wen<aver || g+wen<aver || c+wen<aver || t+wen<aver ){ printf("===\n"); return 0; } for(int i=0;i<n;++i){ if(s[i]=='?'){ if(a<aver){ s[i]='A'; a++; }else if(g<aver){ s[i]='G'; g++; }else if(c<aver){ s[i]='C'; c++; }else if(t<aver){ s[i]='T'; t++; } } } if(a==aver && g==aver && c==aver && t==aver)printf("%s\n",s); else printf("===\n"); } return 0;}
0 0
- Mammoth's Genome Decoding,测英语,测手速,测网速
- Mammoth's Genome Decoding CodeForces
- 747B Mammoth's Genome Decoding
- 【codeforces 747B】Mammoth's Genome Decoding
- CodeForces 747B Mammoth's Genome Decoding
- 【58.33%】【codeforces 747B】Mammoth's Genome Decoding
- Codeforces 747B Mammoth's Genome Decoding(碱基对)
- 【Codeforces 747B Mammoth's Genome Decoding】+ 构造
- Codeforces Round #387 (Div. 2) B. Mammoth's Genome Decoding
- 【每日一题(8)】Mammoth's Genome Decoding CodeForces
- Codeforces Round #387(Div. 2)B. Mammoth's Genome Decoding【模拟】
- Codeforces Round #387 (Div. 2)B. Mammoth's Genome Decoding(水题)
- Codeforces Round #387 (Div. 2)B. Mammoth's Genome Decoding(简单模拟)
- CodeForces 222E Decoding Genome
- 测网速
- Codeforces Round #137 (Div. 2) 222E. Decoding Genome
- 测网速网址
- 网速测函数代码
- 2-4 测试算法的性能-Selection-Sort-Detect-Performance
- 天堂地狱启示录
- 如何用IED编写股票的量化策略?
- c语言中内存字节对齐问题
- Robot Freamwork+Appium移动端(Android)自动化测试环境搭建方法
- Mammoth's Genome Decoding,测英语,测手速,测网速
- Big Bang 详细介绍,锤子科技至今最好的技术
- ubuntu上安装MySQL 废话少说,全是干货~
- C++ explicit关键字详解
- Linux从一般用户切换到root用户
- sql SELECT DISTINCT 表去重
- C# 重构
- 8.1.2数组的返回
- 销售退货票