QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#84100 | #5660. Simplified Genome Translation | HOLIC# | AC ✓ | 2ms | 3500kb | C++20 | 1.6kb | 2023-03-05 14:09:34 | 2023-03-05 14:09:36 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1009;
int fa[N];
map<string, string> vis;
string s;
void work() {
cin >> s;
for(int i = 0; i < s.size(); i += 3) {
string a = "";
a += s[i];
a += s[i + 1];
a += s[i + 2];
if(vis[a] == "STOP") break;
else cout << vis[a];
}
cout << endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int Case = 1;
vis["UUU"] = vis["UUC"] = "F";
vis["UUA"] = vis["UUG"] = vis["CUU"] = vis["CUC"] = vis["CUA"] = vis["CUG"] = "L";
vis["AUU"] = vis["AUC"] = vis["AUA"] = "I";
vis["AUG"] = "M";
vis["GUU"] = vis["GUC"] = vis["GUA"] = vis["GUG"] = "V";
vis["UCU"] = vis["UCC"] = vis["UCA"] = vis["UCG"] = vis["AGU"] = vis["AGC"] = "S";
vis["CCU"] = vis["CCC"] = vis["CCA"] = vis["CCG"] = "P";
vis["ACU"] = vis["ACC"] = vis["ACA"] = vis["ACG"] = "T";
vis["GCU"] = vis["GCC"] = vis["GCA"] = vis["GCG"] = "A";
vis["UAU"] = vis["UAC"] = "Y";
vis["CAU"] = vis["CAC"] = "H";
vis["CAA"] = vis["CAG"] = "Q";
vis["AAU"] = vis["AAC"] = "N";
vis["AAA"] = vis["AAG"] = "K";
vis["GAU"] = vis["GAC"] = "D";
vis["GAA"] = vis["GAG"] = "E";
vis["UGU"] = vis["UGC"] = "C";
vis["UGG"] = "W";
vis["CGU"] = vis["CGC"] = vis["CGA"] = vis["CGG"] = vis["AGA"] = vis["AGG"] = "R";
vis["GGU"] = vis["GGC"] = vis["GGA"] = vis["GGG"] = "G";
vis["UAA"] = vis["UAG"] = vis["UGA"] = "STOP";
cin >> Case;
while(Case --) work();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3444kb
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: 3500kb
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: 3400kb
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