QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#102475 | #5660. Simplified Genome Translation | shunn# | AC ✓ | 3ms | 3496kb | C++20 | 2.4kb | 2023-05-03 13:44:10 | 2023-05-03 13:44:13 |
Judging History
answer
//#include<iostream>
#include <bits//stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
//#define int long long
const int N=1e6+7;
char ch(string x)
{
string a;
a="UUU UUC";
if(a.find(x)!=-1)
{
return 'F';
}
a="UUA UUG CUU CUC CUA CUG";
if(a.find(x)!=-1)
{
return 'L';
}
a="AUU AUC AUA";
if(a.find(x)!=-1)
{
return 'I';
}
a="AUG";
if(a.find(x)!=-1)
{
return 'M';
}
a="GUU GUC GUA GUG";
if(a.find(x)!=-1)
{
return 'V';
}
a="UCU UCC UCA UCG AGU AGC";
if(a.find(x)!=-1)
{
return 'S';
}
a="CCU CCC CCA CCG";
if(a.find(x)!=-1)
{
return 'P';
}
a="ACU ACC ACA ACG";
if(a.find(x)!=-1)
{
return 'T';
}
a="GCU GCC GCA GCG";
if(a.find(x)!=-1)
{
return 'A';
}
a="UAU UAC";
if(a.find(x)!=-1)
{
return 'Y';
}
a="CAU CAC";
if(a.find(x)!=-1)
{
return 'H';
}
a="CAA CAG";
if(a.find(x)!=-1)
{
return 'Q';
}
a="AAU AAC";
if(a.find(x)!=-1)
{
return 'N';
}
a="AAA AAG";
if(a.find(x)!=-1)
{
return 'K';
}
a="GAU GAC";
if(a.find(x)!=-1)
{
return 'D';
}
a="GAA GAG";
if(a.find(x)!=-1)
{
return 'E';
}
a="UGU UGC";
if(a.find(x)!=-1)
{
return 'C';
}
a="UGG";
if(a.find(x)!=-1){
return 'W';
}
a="CGU CGC CGA CGG AGA AGG";
if(a.find(x)!=-1)
{
return 'R';
}
a="GGU GGC GGA GGG";
if(a.find(x)!=-1)
{
return 'G';
}
a="UAA UAG UGA";
if(a.find(x)!=-1)
{
return '0';
}
}
int32_t main()
{
int t;
cin>>t;
string s;
string k,a;
char o;
while (t--)
{
cin>>s;
for(int i=0;i<s.size();i++)
{
k=k+s[i];
if((i+1)%3==0)
{
o=ch(k);
k.clear();
if(o!='0')
{
a=a+o;
}
}
if(o=='0')
{
o='1';
break;
}
}
cout<<a<<endl;
a.clear();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3460kb
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: 3496kb
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: 3416kb
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