QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102415 | #5660. Simplified Genome Translation | flashtomato# | AC ✓ | 2ms | 3532kb | C++14 | 2.2kb | 2023-05-03 12:55:33 | 2023-05-03 12:55:36 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
typedef long long ll;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double pi = acos(-1);
const int N = 110;
set<string> st;
map<string , char> mp;
void solve(){
string s; cin >> s;
vector<char> ans;
for(int i = 0; i + 2< s.size(); i+=3){
string x = "";
x += s[i];
x += s[i+1];
x += s[i+2];
// cout << "x == " << x << '\n';
if(mp[x]) ans.push_back(mp[x]);
if(st.count(x)) break;
}
for (auto x: ans) cout << x;
cout << '\n';
}
int main(){
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _ = 1;
cin >> _;
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["ACG"] = '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';
st.insert("UAA");
st.insert("UAG");
st.insert("UGA");
while(_--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3532kb
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: 3452kb
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: 3512kb
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