QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#525994 | #5660. Simplified Genome Translation | solar_express# | AC ✓ | 1ms | 3824kb | C++23 | 1.4kb | 2024-08-21 09:15:40 | 2024-08-21 09:15:41 |
Judging History
answer
#include <iostream>
#include <map>
#include <string>
std::map<std::string, char> TR = {
{"UUU",'F'},
{"UUC",'F'},
{"UUA",'L'},
{"UUG",'L'},
{"CUU",'L'},
{"CUC",'L'},
{"CUA",'L'},
{"CUG",'L'},
{"AUU",'I'},
{"AUC",'I'},
{"AUA",'I'},
{"AUG",'M'},
{"GUU",'V'},
{"GUC",'V'},
{"GUA",'V'},
{"GUG",'V'},
{"UCU",'S'},
{"UCC",'S'},
{"UCA",'S'},
{"UCG",'S'},
{"AGU",'S'},
{"AGC",'S'},
{"CCU",'P'},
{"CCC",'P'},
{"CCA",'P'},
{"CCG",'P'},
{"ACU",'T'},
{"ACC",'T'},
{"ACA",'T'},
{"ACG",'T'},
{"GCU",'A'},
{"GCC",'A'},
{"GCA",'A'},
{"GCG",'A'},
{"UAU",'Y'},
{"UAC",'Y'},
{"CAU",'H'},
{"CAC",'H'},
{"CAA",'Q'},
{"CAG",'Q'},
{"AAU",'N'},
{"AAC",'N'},
{"AAA",'K'},
{"AAG",'K'},
{"GAU",'D'},
{"GAC",'D'},
{"GAA",'E'},
{"GAG",'E'},
{"UGU",'C'},
{"UGC",'C'},
{"UGG",'W'},
{"CGU",'R'},
{"CGC",'R'},
{"CGA",'R'},
{"CGG",'R'},
{"AGA",'R'},
{"AGG",'R'},
{"GGU",'G'},
{"GGC",'G'},
{"GGA",'G'},
{"GGG",'G'},
{"UAA",'\0'},
{"UAG",'\0'},
{"UGA",'\0'},
};
char ans[400];
int main() {
int T;
std::cin >> T;
while (T--) {
int n;
std::string s;
std::cin >> s;
n = s.length()/3;
for (int i = 0; i < n; ++i) {
ans[i] = TR[s.substr(i*3, 3)];
if (ans[i] == '\0') break;
}
ans[n] = '\0';
std::cout << ans << '\n';
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3524kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 3824kb
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: 1ms
memory: 3772kb
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