QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#524099#5660. Simplified Genome Translationucup-team3699#AC ✓1ms3820kbC++201.3kb2024-08-19 10:24:252024-08-19 10:24:25

Judging History

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

  • [2024-08-19 10:24:25]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3820kb
  • [2024-08-19 10:24:25]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define pb push_back
#define F first 
#define S second 

const int mol=998244353;

map<string, char>m;
void solve(){
    string a;
    cin>>a;
    for(int i=0;i<a.size();i+=3){
        auto q=a.substr(i, 3);
        if(m[q]=='a') break;
        cout<<m[q];
    }
    cout<<"\n";
}


signed main(){
    ios::sync_with_stdio(0);cin.tie(0);
    m["UUU"]= m["UUC"]='F';
    m["UUA"]= m["UUG"]= m["CUU"]= m["CUC"]= m["CUA"]= m["CUG"]='L';
    m["AUU"]= m["AUC"]= m["AUA"]='I';
    m["AUG"]='M';
    m["GUU"]= m["GUC"]= m["GUA"]= m["GUG"]='V';
    m["UCU"]= m["UCC"]= m["UCA"]= m["UCG"]= m["AGU"]= m["AGC"]='S';
    m["CCU"]= m["CCC"]= m["CCA"]= m["CCG"]='P';
    m["ACU"]= m["ACC"]= m["ACA"]= m["ACG"]='T';
    m["GCU"]= m["GCC"]= m["GCA"]= m["GCG"]='A';
    m["UAU"]= m["UAC"]='Y';
    m["CAU"]= m["CAC"]='H';
    m["CAA"]=m["CAG"]='Q';
    m["AAU"]= m["AAC"]='N';
    m["AAA"]= m["AAG"]='K';
    m["GAU"]= m["GAC"]='D';
    m["GAA"]= m["GAG"]='E';
    m["UGU"]= m["UGC"]='C';
    m["UGG"]='W';
    m["CGU"]= m["CGC"]= m["CGA"]= m["CGG"]= m["AGA"]= m["AGG"]='R';
    m["GGU"]= m["GGC"]= m["GGA"]= m["GGG"]='G';
    m["UAA"]= m["UAG"]= m["UGA"]='a';
    int t;
    cin>>t;
    while(t--)
    solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3536kb

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

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

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