QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#94845 | #5660. Simplified Genome Translation | pedroteosousa# | AC ✓ | 3ms | 3632kb | C++14 | 1.1kb | 2023-04-07 23:23:36 | 2023-04-07 23:23:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define maxn 100100
#define pb push_back
string S = "\
\
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 \
Z UAA UAG UGA" ;
char str[maxn];
main(){
map<string,char> mp;
stringstream fin;
fin << S;
string a;
char cur;
while(fin >> a){
//cout << a << endl;
if(a.size() == 1) cur = a[0];
else mp[a] = cur;
}
int nt;
scanf("%d",&nt);
while(nt--){
int stp = 0;
char a,b,c;
scanf(" %s",str);
int n = strlen(str);
for(int i=0;i<n;i+=3){
string s;
s.pb(str[i]);
s.pb(str[i+1]);
s.pb(str[i+2]);
char cur = mp[s];
if(cur == 'Z') stp = 1;
if(stp == 0) printf("%c",cur);
//printf("%c %d\n",cur,stp);
}
printf("\n");
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 3ms
memory: 3532kb
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: 3ms
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