QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#88835#5660. Simplified Genome TranslationPHarrAC ✓4ms3396kbC++171.8kb2023-03-17 18:15:252023-03-17 18:15:27

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-17 18:15:27]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3396kb
  • [2023-03-17 18:15:25]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;



map<string,string> st;

void init(){
    st["UUU"]="F";
    st["UUC"]="F";

    st["UUA"]="L";
    st["UUG"]="L";
    st["CUU"]="L";
    st["CUC"]="L";
    st["CUA"]="L";
    st["CUG"]="L";

    st["AUU"]="I";
    st["AUC"]="I";
    st["AUA"]="I";

    st["AUG"]="M";

    st["GUU"]="V";
    st["GUC"]="V";
    st["GUA"]="V";
    st["GUG"]="V";

    st["UCU"]="S";
    st["UCC"]="S";
    st["UCA"]="S";
    st["UCG"]="S";
    st["AGU"]="S";
    st["AGC"]="S";

    st["CCU"]="P";
    st["CCC"]="P";
    st["CCA"]="P";
    st["CCG"]="P";

    st["ACU"]="T";
    st["ACC"]="T";
    st["ACA"]="T";
    st["ACG"]="T";

    st["GCU"]="A";
    st["GCC"]="A";
    st["GCA"]="A";
    st["GCG"]="A";

    st["UAU"]="Y";
    st["UAC"]="Y";

    st["CAU"]="H";
    st["CAC"]="H";

    st["CAA"]="Q";
    st["CAG"]="Q";

    st["AAU"]="N";
    st["AAC"]="N";

    st["AAA"]="K";
    st["AAG"]="K";

    st["GAU"]="D";
    st["GAC"]="D";

    st["GAA"]="E";
    st["GAG"]="E";

    st["UGU"]="C";
    st["UGC"]="C";

    st["UGG"]="W";

    st["CGU"]="R";
    st["CGC"]="R";
    st["CGA"]="R";
    st["CGG"]="R";
    st["AGA"]="R";
    st["AGG"]="R";

    st["GGU"]="G";
    st["GGC"]="G";
    st["GGA"]="G";
    st["GGG"]="G";

    st["UAA"]="STOP";
    st["UAG"]="STOP";
    st["UGA"]="STOP";
}

void solve(){
    string s , t;
    cin >> s;
    for( int i = 0 ; i < s.size() ; i += 3 ){
        t = s.substr( i , 3 );
        t = st[t];
        if( t == "STOP" ) return cout << "\n" , void();
        cout << t;
    }
    return cout << "\n" , void();
}

int32_t main(){
    init();
    int t;
    cin >> t;
    for( ; t ; t -- ) solve();
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 3268kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3296kb

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: 4ms
memory: 3396kb

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