QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#95685 | #5660. Simplified Genome Translation | SGColin# | AC ✓ | 2ms | 3056kb | C++14 | 1.1kb | 2023-04-11 13:09:54 | 2023-04-11 13:09:56 |
Judging History
answer
#include<map>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1000;
int te,n;char s[maxn+5];
map<string,char> f;
string t;
int main(){
f["UUU"]=f["UUC"]='F';
f["UUA"]=f["UUG"]=f["CUU"]=f["CUC"]=f["CUA"]=f["CUG"]='L';
f["AUU"]=f["AUC"]=f["AUA"]='I';
f["AUG"]='M';
f["GUU"]=f["GUC"]=f["GUA"]=f["GUG"]='V';
f["UCU"]=f["UCC"]=f["UCA"]=f["UCG"]=f["AGU"]=f["AGC"]='S';
f["CCU"]=f["CCC"]=f["CCA"]=f["CCG"]='P';
f["ACU"]=f["ACC"]=f["ACA"]=f["ACG"]='T';
f["GCU"]=f["GCC"]=f["GCA"]=f["GCG"]='A';
f["UAU"]=f["UAC"]='Y';
f["CAU"]=f["CAC"]='H';
f["CAA"]=f["CAG"]='Q';
f["AAU"]=f["AAC"]='N';
f["AAA"]=f["AAG"]='K';
f["GAU"]=f["GAC"]='D';
f["GAA"]=f["GAG"]='E';
f["UGU"]=f["UGC"]='C';
f["UGG"]='W';
f["CGU"]=f["CGC"]=f["CGA"]=f["CGG"]=f["AGA"]=f["AGG"]='R';
f["GGU"]=f["GGC"]=f["GGA"]=f["GGG"]='G';
f["UAA"]=f["UAG"]=f["UGA"]=0;
for (scanf("%d",&te);te;te--){
scanf("%s",s+1);n=strlen(s+1);
for (int i=1;i<=n;i+=3){
t=s[i];t+=s[i+1];t+=s[i+2];
if (f[t]==0) break;
putchar(f[t]);
}
puts("");
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 2968kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 2980kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQREGLLIRSGLSCS NGSLLYHFTRCDT DASYKADEGLMFVLKDTGDYGSDYWQK SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANSSAWT FACST LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS II VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIYNSCYIY TRKLSFS ESDQC QNGIPKKAC PHTRRTLPPSV GI ATSNVCTSFHGAGASGRNVCIRGRDRPL AF NPFQVSRSLQPRS IHPGYLRTGGGFRSILSVTRDG...
result:
ok 50 lines
Test #3:
score: 0
Accepted
time: 2ms
memory: 3056kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQREGLLIRSGLSCS NGSLLYHFTRCDT DASYKADEGLMFVLKDTGDYGSDYWQK SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANSSAWT FACST LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS II VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIYNSCYIY TRKLSFS ESDQC QNGIPKKAC PHTRRTLPPSV GI ATSNVCTSFHGAGASGRNVCIRGRDRPL AF NPFQVSRSLQPRS IHPGYLRTGGGFRSILSVTRDG...
result:
ok 50 lines