QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#626738 | #5660. Simplified Genome Translation | KowerKoint# | AC ✓ | 1ms | 3612kb | C++20 | 1.3kb | 2024-10-10 12:17:20 | 2024-10-10 12:17:21 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
map<char, string> mp;
mp['F'] = "UUUUUC";
mp['L'] = "UUAUUGCUUCUCCUACUG";
mp['I'] = "AUUAUCAUA";
mp['M'] = "AUG";
mp['V'] = "GUUGUCGUAGUG";
mp['S'] = "UCUUCCUCAUCGAGUAGC";
mp['P'] = "CCUCCCCCACCG";
mp['T'] = "ACUACCACAACG";
mp['A'] = "GCUGCCGCAGCG";
mp['Y'] = "UAUUAC";
mp['H'] = "CAUCAC";
mp['Q'] = "CAACAG";
mp['N'] = "AAUAAC";
mp['K'] = "AAAAAG";
mp['D'] = "GAUGAC";
mp['E'] = "GAAGAG";
mp['C'] = "UGUUGC";
mp['W'] = "UGG";
mp['R'] = "CGUCGCCGACGGAGAAGG";
mp['G'] = "GGUGGCGGAGGG";
mp['$'] = "UAAUAGUGA";
map<string, char> rmp;
for(auto [k, v] : mp) {
assert(ssize(v)%3 == 0);
for(int i = 0; i < ssize(v); i += 3) {
string vv = v.substr(i, 3);
assert(!rmp.count(vv));
rmp[vv]= k;
}
}
int t; cin >> t;
while(t--) {
string s; cin >> s;
string t;
for(int i = 0; i < ssize(s); i += 3) {
string ss = s.substr(i, 3);
assert(rmp.count(ss));
t += rmp[ss];
if(t.back() == '$') {
t.pop_back();
break;
}
}
cout << t << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3484kb
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: 3604kb
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: 3612kb
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