QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#505848 | #5660. Simplified Genome Translation | UESTC_DECAYALI# | AC ✓ | 1ms | 3580kb | C++17 | 1.3kb | 2024-08-05 12:27:23 | 2024-08-05 12:27:24 |
Judging History
answer
#include<cstdio>
#include<iostream>
#include<string>
#include<map>
#define RI register int
#define CI const int&
using namespace std;
int t; string s; map <string,string> trs;
int main()
{
trs["UUU"]=trs["UUC"]="F";
trs["UUA"]=trs["UUG"]=trs["CUU"]=trs["CUC"]=trs["CUA"]=trs["CUG"]="L";
trs["AUU"]=trs["AUC"]=trs["AUA"]="I";
trs["AUG"]="M";
trs["GUU"]=trs["GUC"]=trs["GUA"]=trs["GUG"]="V";
trs["UCU"]=trs["UCC"]=trs["UCA"]=trs["UCG"]=trs["AGU"]=trs["AGC"]="S";
trs["CCU"]=trs["CCC"]=trs["CCA"]=trs["CCG"]="P";
trs["ACU"]=trs["ACC"]=trs["ACA"]=trs["ACG"]="T";
trs["GCU"]=trs["GCC"]=trs["GCA"]=trs["GCG"]="A";
trs["UAU"]=trs["UAC"]="Y";
trs["CAU"]=trs["CAC"]="H";
trs["CAA"]=trs["CAG"]="Q";
trs["AAU"]=trs["AAC"]="N";
trs["AAA"]=trs["AAG"]="K";
trs["GAU"]=trs["GAC"]="D";
trs["GAA"]=trs["GAG"]="E";
trs["UGU"]=trs["UGC"]="C";
trs["UGG"]="W";
trs["CGU"]=trs["CGC"]=trs["CGA"]=trs["CGG"]=trs["AGA"]=trs["AGG"]="R";
trs["GGU"]=trs["GGC"]=trs["GGA"]=trs["GGG"]="G";
trs["UAA"]=trs["UAG"]=trs["UGA"]="|";
ios::sync_with_stdio(0); cin.tie(0);
for (cin>>t;t;--t)
{
cin>>s; string ans="";
for (RI i=0;i+2<s.size();i+=3)
{
string tmp=s.substr(i,3);
if (trs[tmp]!="|") ans+=trs[tmp]; else break;
}
cout<<ans<<'\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
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: 3580kb
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: 0ms
memory: 3580kb
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