QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#88835 | #5660. Simplified Genome Translation | PHarr | AC ✓ | 4ms | 3396kb | C++17 | 1.8kb | 2023-03-17 18:15:25 | 2023-03-17 18:15:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
map<string,string> st;
void init(){
st["UUU"]="F";
st["UUC"]="F";
st["UUA"]="L";
st["UUG"]="L";
st["CUU"]="L";
st["CUC"]="L";
st["CUA"]="L";
st["CUG"]="L";
st["AUU"]="I";
st["AUC"]="I";
st["AUA"]="I";
st["AUG"]="M";
st["GUU"]="V";
st["GUC"]="V";
st["GUA"]="V";
st["GUG"]="V";
st["UCU"]="S";
st["UCC"]="S";
st["UCA"]="S";
st["UCG"]="S";
st["AGU"]="S";
st["AGC"]="S";
st["CCU"]="P";
st["CCC"]="P";
st["CCA"]="P";
st["CCG"]="P";
st["ACU"]="T";
st["ACC"]="T";
st["ACA"]="T";
st["ACG"]="T";
st["GCU"]="A";
st["GCC"]="A";
st["GCA"]="A";
st["GCG"]="A";
st["UAU"]="Y";
st["UAC"]="Y";
st["CAU"]="H";
st["CAC"]="H";
st["CAA"]="Q";
st["CAG"]="Q";
st["AAU"]="N";
st["AAC"]="N";
st["AAA"]="K";
st["AAG"]="K";
st["GAU"]="D";
st["GAC"]="D";
st["GAA"]="E";
st["GAG"]="E";
st["UGU"]="C";
st["UGC"]="C";
st["UGG"]="W";
st["CGU"]="R";
st["CGC"]="R";
st["CGA"]="R";
st["CGG"]="R";
st["AGA"]="R";
st["AGG"]="R";
st["GGU"]="G";
st["GGC"]="G";
st["GGA"]="G";
st["GGG"]="G";
st["UAA"]="STOP";
st["UAG"]="STOP";
st["UGA"]="STOP";
}
void solve(){
string s , t;
cin >> s;
for( int i = 0 ; i < s.size() ; i += 3 ){
t = s.substr( i , 3 );
t = st[t];
if( t == "STOP" ) return cout << "\n" , void();
cout << t;
}
return cout << "\n" , void();
}
int32_t main(){
init();
int t;
cin >> t;
for( ; t ; t -- ) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3268kb
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: 3296kb
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: 4ms
memory: 3396kb
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