QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#238756 | #5660. Simplified Genome Translation | ItsJerr# | AC ✓ | 0ms | 3856kb | C++20 | 1.5kb | 2023-11-04 17:26:31 | 2023-11-04 17:26:31 |
Judging History
answer
/*input
5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int t;
cin >> t;
while (t-- > 0)
{
string s;
cin >> s;
int n = s.size();
s = ' ' + s;
n /= 3;
for (int i = 1; i <= n; ++i)
{
string t = s.substr((i - 1) * 3 + 1, 3);
if(t=="UUU"||t=="UUC") cout << "F";
else if(t=="UUA"||t=="UUG"||t=="CUU"||t=="CUA"||t=="CUG"||t=="CUC") cout << "L";
else if(t=="AUU"||t=="AUC"||t=="AUA") cout << "I";
else if(t=="AUG") cout << "M";
else if(t=="GUU"||t=="GUA"||t=="GUC"||t=="GUG") cout << "V";
else if(t=="UCU"||t=="UCC"||t=="UCA"||t=="UCG"||t=="AGU"||t=="AGC") cout << "S";
else if(t=="CCU"||t=="CCC"||t=="CCA"||t=="CCG") cout << "P";
else if(t=="ACU"||t=="ACA"||t=="ACG"||t=="ACC") cout << "T";
else if(t=="GCU"||t=="GCC"||t=="GCA"||t=="GCG") cout << "A";
else if(t=="UAU"||t=="UAC") cout << "Y";
else if(t=="CAU"||t=="CAC") cout << "H";
else if(t=="CAA"||t=="CAG") cout<< "Q";
else if(t=="AAU"||t=="AAC") cout << "N";
else if(t=="AAA"||t=="AAG") cout << "K";
else if(t=="GAU"||t=="GAC") cout << "D";
else if(t=="GAA"||t=="GAG") cout << "E";
else if(t=="UGU"||t=="UGC") cout << "C";
else if(t=="UGG") cout << "W";
else if(t=="CGU"||t=="CGC"||t=="CGA"||t=="CGG"||t=="AGA"||t=="AGG") cout<< 'R';
else if(t=="GGU"||t=="GGC"||t=="GGA"||t=="GGG") cout << "G";
else break;
}
cout << '\n';
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3824kb
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: 3784kb
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: 0ms
memory: 3856kb
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