QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#553705 | #5660. Simplified Genome Translation | BongoCatEnjoyer# | AC ✓ | 0ms | 3784kb | C++20 | 3.1kb | 2024-09-08 18:34:48 | 2024-09-08 18:34:49 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define all(v) (v).begin(), (v).end()
#define forn(var, n) for (ll (var) = 0; (var) < (n); ++(var))
#define forr(var, start, end) for (ll (var) = (start); (var) < (end); ++(var))
#define fori(var, start, end) for (ll (var) = (start); (var) > (end); --(var))
#define fora(var, obj) for (auto (var) : (obj))
#define MOD1 (ll) (1e9 + 7)
#define MOD9 (ll) (998244353)
#define prints(x) cout << (x) << " "
#define println(x) cout << (x) << "\n"
#define newl() cout << "\n"
using namespace std;
void solve() {
string s; cin >> s;
for (ll i = 0; i < s.size(); i += 3) {
if (s.substr(i, 2) == "UU") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'F';
} else {
cout << 'L';
}
} else if (s.substr(i, 2) == "CU") {
cout << 'L';
} else if (s.substr(i, 2) == "AU") {
if (s[i + 2] == 'G') {
cout << 'M';
} else {
cout << 'I';
}
} else if (s.substr(i, 2) == "GU") {
cout << 'V';
} else if (s.substr(i, 2) == "UC") {
cout << 'S';
} else if (s.substr(i, 2) == "AG") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'S';
} else {
cout << 'R';
}
} else if (s.substr(i, 2) == "CC") {
cout << 'P';
} else if (s.substr(i, 2) == "AC") {
cout << 'T';
} else if (s.substr(i, 2) == "GC") {
cout << 'A';
} else if (s.substr(i, 2) == "UA") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'Y';
} else {
break;
}
} else if (s.substr(i, 2) == "CA") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'H';
} else {
cout << 'Q';
}
} else if (s.substr(i, 2) == "AA") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'N';
} else {
cout << 'K';
}
} else if (s.substr(i, 2) == "GA") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'D';
} else {
cout << 'E';
}
} else if (s.substr(i, 2) == "UG") {
if (s[i + 2] == 'U' || s[i + 2] == 'C') {
cout << 'C';
} else if (s[i + 2] == 'G') {
cout << 'W';
} else {
break;
}
} else if (s.substr(i, 2) == "CG") {
cout << 'R';
} else if (s.substr(i, 2) == "GG") {
cout << 'G';
}
}
newl();
return;
}
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll t = 1;
cin >> t;
while (t--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
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: 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: 0ms
memory: 3548kb
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