QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102947 | #5660. Simplified Genome Translation | wakakaka | AC ✓ | 3ms | 3424kb | C++17 | 1.4kb | 2023-05-03 20:28:43 | 2023-05-03 20:28:45 |
Judging History
answer
#include <iostream>
using namespace std;
string s;
int main()
{
int all;
cin>>all;
while(all--)
{
cin>>s;
int len=s.size();
for(int i=0;i<len;i+=3)
{
string t;
t+=s[i];t+=s[i+1];t+=s[i+2];
if(t=="UUU"||t=="UUC") cout<<"F";
else if(t=="UUA"||t=="UUG"||t=="CUU"||t=="CUC"||t=="CUA"||t=="CUG") cout<<"L";
else if(t=="AUU"||t=="AUC"||t=="AUA") cout<<"I";
else if(t=="AUG") cout<<"M";
else if(t=="GUU"||t=="GUC"||t=="GUA"||t=="GUG") cout<<"V";
else if(t=="UCU"||t=="UCC"||t=="UCA"||t=="UCG"||t=="AGU"||t=="AGC") cout<<"S";
else if(t=="CCU"||t=="CCC"||t=="CCA"||t=="CCG") cout<<"P";
else if(t=="ACU"||t=="ACC"||t=="ACA"||t=="ACG") cout<<"T";
else if(t=="GCU"||t=="GCC"||t=="GCA"||t=="GCG") cout<<"A";
else if(t=="UAU"||t=="UAC") cout<<"Y";
else if(t=="CAU"||t=="CAC") cout<<"H";
else if(t=="CAA"||t=="CAG") cout<<"Q";
else if(t=="AAU"||t=="AAC") cout<<"N";
else if(t=="AAA"||t=="AAG") cout<<"K";
else if(t=="GAU"||t=="GAC") cout<<"D";
else if(t=="GAA"||t=="GAG") cout<<"E";
else if(t=="UGU"||t=="UGC") cout<<"C";
else if(t=="UGG") cout<<"W";
else if(t=="CGU"||t=="CGC"||t=="CGA"||t=="CGG"||t=="AGA"||t=="AGG") cout<<"R";
else if(t=="GGU"||t=="GGC"||t=="GGA"||t=="GGG") cout<<"G";
else if(t=="UAA"||t=="UAG"||t=="UGA") break;
}
cout<<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3368kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 3380kb
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: 3424kb
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