QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#184617#5660. Simplified Genome TranslationSayedHassan#AC ✓1ms3844kbC++141.9kb2023-09-20 23:10:282023-09-20 23:10:28

Judging History

你现在查看的是最新测评结果

  • [2023-09-20 23:10:28]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3844kb
  • [2023-09-20 23:10:28]
  • 提交

answer

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;



int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    map<string,char> mp;
    mp["UUU"]=mp["UUC"]='F';
    mp["UUA"]=mp["UUG"]=mp["CUU"]=mp["CUC"]=mp["CUA"]=mp["CUG"]='L';
    mp["AUU"]=mp["AUC"]=mp["AUA"]='I';
    mp["AUG"]='M';
    mp["GUU"]=mp["GUC"]=mp["GUA"]=mp["GUG"]='V';
    mp["UCU"]=mp["UCC"]=mp["UCA"]=mp["UCG"]=mp["AGU"]=mp["AGC"]='S';
    mp["CCU"]=mp["CCC"]=mp["CCA"]=mp["CCG"]='P';
    mp["ACU"]=mp["ACC"]=mp["ACA"]=mp["ACG"]='T';
    mp["GCU"]=mp["GCC"]=mp["GCA"]=mp["GCG"]='A';
    mp["UAU"]=mp["UAC"]='Y';
    mp["CAU"]=mp["CAC"]='H';
    mp["CAA"]=mp["CAG"]='Q';
    mp["AAU"]=mp["AAC"]='N';
    mp["AAA"]=mp["AAG"]='K';
    mp["GAU"]=mp["GAC"]='D';
    mp["GAA"]=mp["GAG"]='E';
    mp["UGU"]=mp["UGC"]='C';
    mp["UGG"]='W';
    mp["CGU"]=mp["CGC"]=mp["CGA"]=mp["CGG"]=mp["AGA"]=mp["AGG"]='R';
    mp["GGU"]=mp["GGC"]=mp["GGA"]=mp["GGG"]='G';
    mp["UAA"]=mp["UAG"]=mp["UGA"]='.';
    /*vector<string> v;
    while(1)
    {
        char c;
        cin>>c;
        if(c=='.')
        {
            for(auto x:v)cout<<x<<endl;
            break;
        }
        string s;
        string t;
        while(1)
        {
            cin>>s;
            if(s[0]=='.')break;
            t=t+"mp[\"";
            t=t+s;
            t=t+"\"]";
            t=t+"=";
        }
        t=t+"\'";
        t.push_back(c);
        t=t+"\';";
        v.push_back(t);


    }*/
    int t;
    cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        for(int i=0;i<s.size();i+=3)
        {
            string t;
            t.push_back(s[i]);
            t.push_back(s[i+1]);
            t.push_back(s[i+2]);
            if(mp[t]=='.')
            {
                break;
            }
            cout<<mp[t];
        }
        cout<<'\n';
    }
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3636kb

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: 3844kb

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: 3812kb

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