QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#166831#5660. Simplified Genome TranslationYiaWA 2ms3432kbC++141.7kb2023-09-06 19:05:532023-09-06 19:05:53

Judging History

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

  • [2023-09-06 19:05:53]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3432kb
  • [2023-09-06 19:05:53]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
string codon(string par){
    if(par=="UUU" || par=="UUC") return "F";
    if(par=="UUA" || par=="UUG" || par=="CUU" || par=="CUC" || par=="CUA" || par=="CUG") return "L";
    if(par=="AUU" || par=="AUC" || par=="AUA") return "I";
    if(par=="AUG") return "M";
    if(par=="GUU" || par=="GUC" || par=="GUA" || par=="GUG") return "V";
    if(par=="UCU" || par=="UUC" || par=="UCA" || par=="UCG" || par=="AGU" || par=="AGC") return "S";
    if(par=="CCU" || par=="CCC" || par=="CCA" || par=="CCG") return "P";
    if(par=="ACU" || par=="ACC" || par=="ACA" || par=="ACG") return "T";
    if(par=="GCU" || par=="GCC" || par=="GCA" || par=="GCG") return "A";
    if(par=="UAU" || par=="UAC") return "Y";
    if(par=="CAU" || par=="CAC") return "H";
    if(par=="CAA" || par=="CAG") return "Q";
    if(par=="AAU" || par=="AAC") return "N";
    if(par=="AAA" || par=="AAG") return "K";
    if(par=="GAU" || par=="GAC") return "D";
    if(par=="GAA" || par=="GAG") return "E";
    if(par=="UGU" || par=="UGC") return "C";
    if(par=="UGG") return "W";
    if(par=="CGU" || par=="CGC" || par=="CGA" || par=="CGG" || par=="AGA" || par=="AGG") return "R";
    if(par=="GGU" || par=="GGC" || par=="GGA" || par=="GGG") return "G";
    if(par=="UAA" || par=="UAG" || par=="UGA") return "STOP";
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int m;
    cin>>m;
    while(m--){
        string R;
        cin>>R;
        for(int i=0;i<R.length();i+=3){
            string par=R.substr(i,3);
            if(codon(par)=="STOP") break;
            else cout<<codon(par);
        }
        cout<<"\n";
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3424kb

input:

50
GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU
AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...

output:

GQREGLLIRSGLSCS
NGSLLYHFTRCDT
DASYKADEGLMFVLKDTGDYG
SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANS
FACST
LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS
II
VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIYNSCYIY
TRKLSFS
ESDQC
QNGIPKKAC
PHTRRTLPPSV
GI
ATSNVCTSFHGAGASGRNVCIRGRDRPL
AF
NPFQVSRSLQPRS
IHPGYLRTGGGFRSILSVTRDGLRRHRTRYEC...

result:

wrong answer 3rd lines differ - expected: 'DASYKADEGLMFVLKDTGDYGSDYWQK', found: 'DASYKADEGLMFVLKDTGDYG'