QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#656634#5660. Simplified Genome Translationucup-team5234#AC ✓2ms3800kbC++231.4kb2024-10-19 13:27:502024-10-19 13:27:51

Judging History

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

  • [2024-10-19 13:27:51]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3800kb
  • [2024-10-19 13:27:50]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;
map<char,vector<string>> M;

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3780kb

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: 2ms
memory: 3600kb

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