QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#549695 | #5660. Simplified Genome Translation | Tiga_Pilot_2# | AC ✓ | 1ms | 3632kb | C++20 | 1.5kb | 2024-09-06 19:42:20 | 2024-09-06 19:42:20 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define FOR(a, b) for (int i = (int) a; i < (int) b; i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
map<string, string> mpx = {
{"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"},
{"", "UAA UAG UGA"}
};
map<string, string> mpy;
for(auto [p, q]: mpx) {
stringstream ss(q);
string s;
while(ss >> s) {
mpy[s] = p;
}
}
int T;
cin >> T;
while(T--) {
string s;
cin >> s;
for(int i=0; i<s.size(); i+=3) {
string t = s.substr(i, 3);
if(mpy[t] == "") {
break;
}
cout << mpy[t];
}
cout << "\n";
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3508kb
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: 3596kb
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: 3632kb
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