QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#102429 | #5660. Simplified Genome Translation | wakakaka# | AC ✓ | 2ms | 3528kb | C++17 | 1.9kb | 2023-05-03 13:03:40 | 2023-05-03 13:03:52 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define endl '\n'
#define int long long
using namespace std;
const int N = 2e5+10 , M = 1e6+10 ;
int k[N];
int n,m,x,ans;
map<string , string> mp;
void init(){
mp["UUU"] = "F";
mp["UUC"] = "F";
mp["UUA"] = "L" , mp["UUG"] = "L" , mp["CUU"] = "L" , mp["CUC"] = "L";
mp["CUA"] = "L" , mp["CUG"] = "L";
mp["AUU"] = "I" , mp["AUC"] = "I" , mp["AUA"] = "I";
mp["AUG"] = "M";
mp["GUU"] = "V" , mp["GUC"] = "V" , mp["GUA"] = "V" , mp["GUG"] = "V";
mp["UCU"] = "S" , mp["UCC"] = "S" , mp["UCA"] = "S" , mp["UCG"] = "S";
mp["AGU"] = "S" , mp["AGC"] = "S";
mp["CCC"] = "P" , mp["CCA"] = "P" , mp["CCU"] = "P" , mp["CCG"] = "P";
mp["ACC"] = "T" , mp["ACA"] = "T" , mp["ACU"] = "T" , mp["ACG"] = "T";
mp["GCC"] = "A" , mp["GCA"] = "A" , mp["GCU"] = "A" , mp["GCG"] = "A";
mp["UAU"] = "Y" , mp["UAC"] = "Y";
mp["CAU"] = "H" , mp["CAC"] = "H" , mp["CAA"] = "Q" , mp["CAG"] = "Q";
mp["AAU"] = "N" , mp["AAC"] = "N" , mp["AAA"] = "K" , mp["AAG"] = "K";
mp["GAU"] = "D" , mp["GAC"] = "D" , mp["GAA"] = "E" , mp["GAG"] = "E";
mp["UGU"] = "C" , mp["UGC"] = "C" , mp["UGG"] = "W";
mp["CGC"] = "R" , mp["CGA"] = "R" , mp["CGU"] = "R" , mp["CGG"] = "R";
mp["AGA"] = "R" , mp["AGG"] = "R";
mp["GGA"] = "G" , mp["GGC"] = "G" , mp["GGU"] = "G" , mp["GGG"] = "G";
mp["UAA"] = "STOP" , mp["UAG"] = "STOP" , mp["UGA"] = "STOP";
}
void solve() {
string s;
cin >> s;
for(int i=0;i<s.size();i+=3) {
string d = "";
d += s[i];
d += s[i+1];
d += s[i+2];
if(mp[d]=="STOP") break;
else cout << mp[d] ;
}
cout << endl;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0) , cout.tie(0);
int T = 1;
cin >> T ;
init();
while(T--) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3432kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3528kb
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: 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