QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#638044 | #5660. Simplified Genome Translation | wmw# | AC ✓ | 1ms | 3804kb | C++20 | 1.6kb | 2024-10-13 14:44:45 | 2024-10-13 14:44:45 |
Judging History
answer
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define prs(v) sort(all(v)); v.erase(unique(all(v)), v.end())
using namespace std;
using ll = long long;
int main() {
cin.tie(0)->sync_with_stdio(0);
map<string, set<string> > m = {
{"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"}}
};
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
vector<string> v;
for (int i = 0; i < s.length(); i += 3) {
string cur = s.substr(i, 3);
bool found = false;
for (auto &[a, b]: m) {
if (b.contains(cur)) {
v.push_back(a);
found = true;
}
}
if (not found) {
break;
}
}
for (auto i: v) {
cout << i;
}
cout << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3804kb
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: 3668kb
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