QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#102490 | #5660. Simplified Genome Translation | north_h# | AC ✓ | 3ms | 3460kb | C++14 | 2.8kb | 2023-05-03 13:54:01 | 2023-05-03 13:54:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using namespace std;
const int N = 30;
char a[N];
int main() {
// ios::sync_with_stdio(0);
// cin.tie(0);
// cout.tie(0);
set<string> st[N];
a[1] = 'F';
st[1].insert("UUU");
st[1].insert("UUC");
a[2] = 'L';
st[2].insert("UUA");
st[2].insert("UUG");
st[2].insert("CUU");
st[2].insert("CUC");
st[2].insert("CUA");
st[2].insert("CUG");
a[3] = 'I';
st[3].insert("AUU");
st[3].insert("AUC");
st[3].insert("AUA");
a[4] = 'M';
st[4].insert("AUG");
a[5] = 'V';
st[5].insert("GUU");
st[5].insert("GUC");
st[5].insert("GUA");
st[5].insert("GUG");
a[6] = 'S';
st[6].insert("UCU");
st[6].insert("UCC");
st[6].insert("UCA");
st[6].insert("UCG");
st[6].insert("AGU");
st[6].insert("AGC");
a[7] = 'P';
st[7].insert("CCU");
st[7].insert("CCC");
st[7].insert("CCA");
st[7].insert("CCG");
a[8] = 'T';
st[8].insert("ACU");
st[8].insert("ACC");
st[8].insert("ACA");
st[8].insert("ACG");
a[9] = 'A';
st[9].insert("GCU");
st[9].insert("GCC");
st[9].insert("GCA");
st[9].insert("GCG");
a[10] = 'Y';
st[10].insert("UAU");
st[10].insert("UAC");
a[11] = 'H';
st[11].insert("CAU");
st[11].insert("CAC");
a[12] = 'Q';
st[12].insert("CAA");
st[12].insert("CAG");
a[13] = 'N';
st[13].insert("AAU");
st[13].insert("AAC");
a[14] = 'K';
st[14].insert("AAA");
st[14].insert("AAG");
a[15] = 'D';
st[15].insert("GAU");
st[15].insert("GAC");
a[16] = 'E';
st[16].insert("GAA");
st[16].insert("GAG");
a[17] = 'C';
st[17].insert("UGU");
st[17].insert("UGC");
a[18] = 'W';
st[18].insert("UGG");
a[19] = 'R';
st[19].insert("CGU");
st[19].insert("CGC");
st[19].insert("CGA");
st[19].insert("CGG");
st[19].insert("AGA");
st[19].insert("AGG");
a[20] = 'G';
st[20].insert("GGU");
st[20].insert("GGC");
st[20].insert("GGA");
st[20].insert("GGG");
st[21].insert("UAA");
st[21].insert("UAG");
st[21].insert("UGA");
int n;
cin >> n;
getchar();
while (n--) {
string s;
cin >> s;
for (int i = 0; i < s.size(); i += 3) {
string str = s.substr(i, 3);
//cout<<str<<endl;
if (st[21].count(str))break;
for (int j = 1; j <= 20; j++) {
if (st[j].count(str)) {
//cout<<j<<endl;
cout << a[j];
break;
}
}
}
cout << endl;
}
//cout<<n<<endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3460kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 3388kb
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: 3ms
memory: 3412kb
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