QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#320483 | #5660. Simplified Genome Translation | ushg8877 | AC ✓ | 1ms | 3756kb | C++20 | 1.3kb | 2024-02-03 17:14:35 | 2024-02-03 17:14:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MP make_pair
mt19937 rnd(time(0));
void solve(){
string t;cin>>t;
int n=t.length()/3;
for(int i=0;i<n;i++){
string s(3,' ');s[0]=t[3*i],s[1]=t[3*i+1],s[2]=t[3*i+2];
if(s=="UUU"||s=="UUC") cout<<"F";
if(s=="UUA"||s=="UUG"||s=="CUU"||s=="CUC"||s=="CUA"||s=="CUG") cout<<"L";
if(s=="AUU"||s=="AUC"||s=="AUA") cout<<"I";
if(s=="AUG") cout<<"M";
if(s=="GUU"||s=="GUC"||s=="GUA"||s=="GUG") cout<<"V";
if(s=="UCU"||s=="UCC"||s=="UCA"||s=="UCG"||s=="AGU"||s=="AGC") cout<<"S";
if(s=="CCU"||s=="CCC"||s=="CCA"||s=="CCG") cout<<"P";
if(s=="ACU"||s=="ACC"||s=="ACA"||s=="ACG") cout<<"T";
if(s=="GCU"||s=="GCC"||s=="GCA"||s=="GCG") cout<<"A";
if(s=="UAU"||s=="UAC") cout<<"Y";
if(s=="CAU"||s=="CAC") cout<<"H";
if(s=="CAA"||s=="CAG") cout<<"Q";
if(s=="AAU"||s=="AAC") cout<<"N";
if(s=="AAA"||s=="AAG") cout<<"K";
if(s=="GAU"||s=="GAC") cout<<"D";
if(s=="GAA"||s=="GAG") cout<<"E";
if(s=="UGU"||s=="UGC") cout<<"C";
if(s=="UGG") cout<<"W";
if(s=="CGU"||s=="CGC"||s=="CGA"||s=="CGG"||s=="AGA"||s=="AGG") cout<<"R";
if(s=="GGU"||s=="GGC"||s=="GGA"||s=="GGG") cout<<"G";
if(s=="UAA"||s=="UAG"||s=="UGA") break;
}
cout<<endl;
}
int main(){
ios::sync_with_stdio(false);
int _;cin>>_;
while(_--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3756kb
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: 3736kb
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: 1ms
memory: 3636kb
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