QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#89288 | #5660. Simplified Genome Translation | katoli# | AC ✓ | 2ms | 3652kb | C++14 | 1.8kb | 2023-03-19 15:53:00 | 2023-03-19 15:53:01 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
char F[100][4]={ "UUU" ,"UUC"};
char L[100][4]={"UUA", "UUG", "CUU" ,"CUC", "CUA", "CUG"};
char I[100][4]={"AUU","AUC", "AUA"};
char M[100][4]= {"AUG"};
char V[100][4]= {"GUU","GUC","GUA","GUG"};
char S[100][4]= {"UCU","UCC","UCA","UCG","AGU","AGC"};
char P[100][4]= {"CCU","CCC","CCA","CCG"};
char T[100][4]= {"ACU","ACC","ACA","ACG"};
char A[100][4]= {"GCU","GCC","GCA","GCG"};
char Y[100][4]= {"UAU","UAC"};
char H[100][4]= {"CAU","CAC"};
char Q[100][4]= {"CAA","CAG"};
char N[100][4]= {"AAU","AAC"};
char K[100][4]= {"AAA","AAG"};
char D[100][4]= {"GAU","GAC"};
char E[100][4]= {"GAA","GAG"};
char C[100][4]= {"UGU","UGC"};
char W[100][4]= {"UGG"};
char R[100][4]= {"CGU","CGC","CGA","CGG","AGA","AGG"};
char G[100][4]= {"GGU","GGC","GGA","GGG"};
char STOP[100][4]={"UAA", "UAG", "UGA"};
char hs[110000];
void tian(char s[100][4],char t){
for (int i=0;i<=10;i++){
if (s[i][0]==0)break;
int zhi=(s[i][0]-'A')*900+(s[i][1]-'A')*30+(s[i][2]-'A');
hs[zhi]=t;
}
}
char sr[110000];
int main()
{
memset(hs,0,sizeof(hs));
tian(F,'F');
tian(L,'L');
tian(I,'I');
tian(M,'M');
tian(V,'V');
tian(S,'S');
tian(P,'P');
tian(T,'T');
tian(A,'A');
tian(Y,'Y');
tian(H,'H');
tian(Q,'Q');
tian(N,'N');
tian(K,'K');
tian(D,'D');
tian(E,'E');
tian(C,'C');
tian(W,'W');
tian(R,'R');
tian(G,'G');
tian(STOP,'.');
int t;scanf("%d",&t);
while (t--){
scanf("%s",sr+1);
int cd=strlen(sr+1);
for (int i=1;i<=cd;i+=3){
int zhi=(sr[i]-'A')*900+(sr[i+1]-'A')*30+(sr[i+2]-'A');
if (hs[zhi]=='.')break;
else printf("%c",hs[zhi]);
}
printf("\n");
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3652kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3644kb
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: 2ms
memory: 3644kb
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