QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#132287 | #5660. Simplified Genome Translation | willow# | AC ✓ | 2ms | 3596kb | C++14 | 1.3kb | 2023-07-29 13:16:03 | 2023-07-29 13:16:07 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
map<string, string> to;
string s, ans;
int T;
int main() {
to["UUU"] = to["UUC"] = "F";
to["UUA"] = to["UUG"] = to["CUU"] = to["CUC"] = to["CUA"] = to["CUG"] = "L";
to["AUU"] = to["AUC"] = to["AUA"] = "I";
to["AUG"] = "M";
to["GUU"] = to["GUC"] = to["GUA"] = to["GUG"] = "V";
to["UCU"] = to["UCC"] = to["UCA"] = to["UCG"] = to["AGU"] = to["AGC"] = "S";
to["CCU"] = to["CCC"] = to["CCA"] = to["CCG"] = "P";
to["ACU"] = to["ACC"] = to["ACA"] = to["ACG"] = "T";
to["GCU"] = to["GCC"] = to["GCA"] = to["GCG"] = "A";
to["UAU"] = to["UAC"] = "Y";
to["CAU"] = to["CAC"] = "H";
to["CAA"] = to["CAG"] = "Q";
to["AAU"] = to["AAC"] = "N";
to["AAA"] = to["AAG"] = "K";
to["GAU"] = to["GAC"] = "D";
to["GAA"] = to["GAG"] = "E";
to["UGU"] = to["UGC"] = "C";
to["UGG"] = "W";
to["CGU"] = to["CGC"] = to["CGA"] = to["CGG"] = to["AGA"] = to["AGG"] = "R";
to["GGU"] = to["GGC"] = to["GGA"] = to["GGG"] = "G";
to["UAA"] = to["UAG"] = to["UGA"] = "stop";
ios :: sync_with_stdio(false);
cin.tie(0), cout.tie(0);
for(cin >> T; T --; ) {
cin >> s;
int n = s.length();
ans = "";
for(int i = 0; i < n; i += 3) {
string now = s.substr(i, 3);
now = to[now];
if(now == "stop")
break;
ans += now;
}
cout << ans << endl;
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3452kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3516kb
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: 3596kb
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