QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#183612 | #5660. Simplified Genome Translation | real_sigma_team# | AC ✓ | 1ms | 3484kb | C++20 | 3.2kb | 2023-09-19 18:17:52 | 2023-09-19 18:17:53 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using ll = long long;
const int N = 3e5 + 5;
map<string, string> mp = {{"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","STOP"},
{"UAG","STOP"},
{"UGA","STOP"}};
void solve() {
string s;
cin >> s;
int x = sz(s);
for (int i = 0; i < x; i += 3) {
string d = s.substr(i, 3);
string f = mp[d];
if (f == "STOP") {
break;
}
cout << f;
}
cout << '\n';
}
int main() {
#ifndef LOCAL
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#else
freopen("input.txt", "r", stdin);
#endif
int t;
cin >> t;
while (t--)
solve();
return 0;
}
详细
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: 3436kb
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: 3472kb
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