QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#184008 | #5660. Simplified Genome Translation | ucup-team1209# | AC ✓ | 1ms | 3572kb | C++20 | 1.2kb | 2023-09-20 10:25:19 | 2023-09-20 10:25:19 |
Judging History
answer
#include<bits/stdc++.h>
using std::cin;
using std::cout;
std::string s[] = {"F", "UUU", "UUC", "L", "UUA", "UUG", "CUU", "CUC", "CUA", "CUG", "I", "AUU", "AUC", "AUA", "M", "AUG", "V", "GUU", "GUC", "GUA", "GUG", "S", "UCU", "UCC", "UCA", "UCG", "AGU", "AGC", "P", "CCU", "CCC", "CCA", "CCG", "T", "ACU", "ACC", "ACA", "ACG", "A", "GCU", "GCC", "GCA", "GCG", "Y", "UAU", "UAC", "H", "CAU", "CAC", "Q", "CAA", "CAG", "N", "AAU", "AAC", "K", "AAA", "AAG", "D", "GAU", "GAC", "E", "GAA", "GAG", "C", "UGU", "UGC", "W", "UGG", "R", "CGU", "CGC", "CGA", "CGG", "AGA", "AGG", "G", "GGU", "GGC", "GGA", "GGG", "STOP", "UAA", "UAG", "UGA",};
std::map<std::string, int> map;
int main() {
std::ios::sync_with_stdio(false), cin.tie(0);
int name = 0;
for(auto x : s) {
if(x.size() != 3) {
if(x == "STOP") {
name = 0;
} else {
name = (int) x[0];
}
} else {
map[x] = name;
}
}
int T;
cin >> T;
for(int i = 0;i < T;++i) {
std::string s, ans;
cin >> s;
for(int i = 0;i < (int) s.size();i += 3) {
std::string t;
t += s[i + 0];
t += s[i + 1];
t += s[i + 2];
char c = map[t];
if(!c) {
break;
} else {
ans += c;
}
}
cout << ans << '\n';
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3544kb
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: 3508kb
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: 3572kb
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