QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#166831 | #5660. Simplified Genome Translation | Yia | WA | 2ms | 3432kb | C++14 | 1.7kb | 2023-09-06 19:05:53 | 2023-09-06 19:05:53 |
Judging History
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;
}
详细
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'