QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102455 | #5660. Simplified Genome Translation | Joler# | AC ✓ | 2ms | 3520kb | C++14 | 4.2kb | 2023-05-03 13:28:43 | 2023-05-03 13:28:45 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#ifdef LOCAL
template<class t,class u>ostream& operator<<(ostream& os,const pair<t,u>& p){return os<<"("<<p.first<<","<<p.second<<")";}
#endif
template<class t>ostream& operator<<(ostream& os,const vector<t>& v){if(v.size())os<<v[0];for(int i=1; i<v.size(); i++)os<<' '<<v[i]; return os;}
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
int n, m, t, k, a, b, c, d, cnt, mark, an, oT_To, x, y, z;
ll 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["CCU"] = "P";
mp["CCC"] = "P";
mp["CCA"] = "P";
mp["CCG"] = "P";
mp["ACU"] = "T";
mp["ACC"] = "T";
mp["ACA"] = "T";
mp["ACG"] = "T";
mp["GCU"] = "A";
mp["GCC"] = "A";
mp["GCA"] = "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["CGU"] = "R";
mp["CGC"] = "R";
mp["CGA"] = "R";
mp["CGG"] = "R";
mp["AGA"] = "R";
mp["AGG"] = "R";
mp["GGU"] = "G";
mp["GGC"] = "G";
mp["GGA"] = "G";
mp["GGG"] = "G";
mp["UAA"] = "STOP";
mp["UAG"] = "STOP";
mp["UGA"] = "STOP";
}
struct Solver {
void solve() {
string s, sf;
cin >> s;
for (int i = 0; i < s.size(); i += 3) {
sf = mp[s.substr(i, 3)];
if (sf.size() == 4) {
cout << '\n';
return;
}
cout << sf;
}
cout << '\n';
// while (cin >> s) {
// if(s.size() != 3) {
// sf = s;
// } else {
// cout << "mp[\"" << s << "\"] = \"" << sf << "\";\n";
// }
// if (s == "UGA") return;
// }
}
};
int main () {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
init();
oT_To = 1;
cin >> oT_To;
while (oT_To--) {
Solver solver;
solver.solve();
}
}
//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[CCU] = "P"
//mp[CCC] = "P"
//mp[CCA] = "P"
//mp[CCG] = "P"
//mp[ACU] = "T"
//mp[ACC] = "T"
//mp[ACA] = "T"
//mp[ACG] = "T"
//mp[GCU] = "A"
//mp[GCC] = "A"
//mp[GCA] = "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[CGU] = "R"
//mp[CGC] = "R"
//mp[CGA] = "R"
//mp[CGG] = "R"
//mp[AGA] = "R"
//mp[AGG] = "R"
//mp[GGU] = "G"
//mp[GGC] = "G"
//mp[GGA] = "G"
//mp[GGG] = "G"
//mp[UAA] = "STOP"
//mp[UAG] = "STOP"
//mp[UGA] = "STOP"
//F UUU UUC
//L UUA UUG CUU CUC CUA CUG
//I AUU AUC AUA
//M AUG
//V GUU GUC GUA GUG
//S UCU UCC UCA UCG AGU AGC
//P CCU CCC CCA CCG
//T ACU ACC ACA ACG
//A GCU GCC GCA GCG
//Y UAU UAC
//H CAU CAC
//Q CAA CAG
//N AAU AAC
// K AAA AAG
//D GAU GAC
// E GAA GAG
//C UGU UGC
// W UGG
// R CGU CGC CGA CGG AGA AGG
//G GGU GGC GGA GGG
// STOP UAA UAG UGA
Details
Tip: Click on the bar to expand more detailed information
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: 2ms
memory: 3520kb
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: 3448kb
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