QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#110340 | #5660. Simplified Genome Translation | ycccc319# | AC ✓ | 4ms | 3460kb | C++20 | 1.2kb | 2023-06-01 16:30:36 | 2023-06-01 16:52:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
vector<string> a{
{"UUUUUC"},
{"UUAUUGCUUCUCCUACUG"},
{"AUUAUCAUA"},
{"AUG"},
{"GUUGUCGUAGUG"},
{"UCUUCCUCAUCGAGUAGC"},
{"CCUCCCCCACCG"},
{"ACUACCACAACG"},
{"GCUGCCGCAGCG"},
{"UAUUAC"},
{"CAUCAC"},
{"CAACAG"},
{"AAUAAC"},
{"AAAAAG"},
{"GAUGAC"},
{"GAAGAG"},
{"UGUUGC"},
{"UGG"},
{"CGUCGCCGACGGAGAAGG"},
{"GGUGGCGGAGGG"},
{"UAAUAGUGA"}
};
const char* s = "FLIMVSPTAYHQNKDECWRG";
int main() {
int T;
cin>>T;
while (T--)
{
string h,ret;cin >> h;
for(int i = 0;i < h.size();) {
for(int j = 0;j < a.size(); ++j) {
for(int k = 0;k < a[j].size(); k += 3) {
if(h.substr(i,3) == a[j].substr(k,3)) {
char c = s[j];
if(!c)i = INT32_MAX;
else i += 3, ret += c;
break;
}
}
}
}
cout << ret << '\n';
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3388kb
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: 3460kb
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: 4ms
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