QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#204012 | #5660. Simplified Genome Translation | keidas | WA | 1ms | 3656kb | C++14 | 1.7kb | 2023-10-06 23:46:31 | 2023-10-06 23:46:31 |
Judging History
answer
#include <bits/stdc++.h>
#define edl '\n'
using namespace std;
typedef long long ll;
const int N=1e6+5;
/*
*/
void slove()
{
string x;
cin>>x;
map<string,string>mp;
mp["UUU"]="F";
mp["UUC"]="F";
mp["UUA"]="L";
mp["UUG"]="L";
mp["CUU"]="L";
mp["CUC"]="L";
mp["CUA"]="L";
mp["CUG"]="L";
mp["AUA"]="I";
mp["AUC"]="I";
mp["AUU"]="I";
mp["AUG"]="M";
mp["GUU"]="V";
mp["GUC"]="V";
mp["GUA"]="V";
mp["GUG"]="V";
mp["UCU"]="S";
mp["UCC"]="S";
mp["UCA"]="S";
mp["AGU"]="S";
mp["AGC"]="S";
mp["UCG"]="S";
mp["GCU"]="A";
mp["GCC"]="A";
mp["GCA"]="A";
mp["GCG"]="A";
mp["UAU"]="Y";
mp["UAC"]="Y";
mp["CAU"]="H";
mp["CAC"]="H";
mp["CAA"]="Q";
mp["CAG"]="Q";
mp["AAC"]="N";
mp["AAU"]="N";
mp["AAA"]="K";
mp["AAG"]="K";
mp["GAU"]="D";
mp["GAC"]="D";
mp["UGC"]="C";
mp["UGU"]="C";
mp["UGG"]="W";
mp["CGU"]="R";
mp["CGC"]="R";
mp["CGA"]="R";
mp["CGG"]="R";
mp["AGA"]="R";
mp["AGG"]="R";
mp["GGU"]="G";
mp["GGC"]="G";
mp["GGA"]="G";
mp["GGG"]="G";
string tm;
string ad="abc";
for(int i=0;i<x.size();i+=3)
{
ad[0]=x[i];
ad[1]=x[i+1];
ad[2]=x[i+2];
// cout<<ad<<" "<<"ok"<<edl;
if(ad=="UAA"||ad=="UAG"||ad=="UGA")
{
break;
}
else
{
cout<<mp[ad];
}
}
cout<<edl;
}
int main()
{
int t=1;
cin>>t;
while(t--)
slove();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3656kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQRGLLIRSGLSCS NGSLLYHFRCD DASYKADGLMFVLKDGDYGSDYWQK SRKVLVDRISLVVAYLGDVDGANIGSKFDGANSSAW FACS LNARSFYALRFKDACKYCKSLFLFSNRGQFS II VLLRAARISCFIHCRCSRRGFGLSCRLAGVGSMIYNSCYIY RKLSFS SDQC QNGIKKAC HRRLSV GI ASNVCSFHGAGASGRNVCIRGRDRL AF NFQVSRSLQRS IHGYLRGGGFRSILSVRDGLRRHRRYCSRDNALQGQRLQSHSLLIIYYCVYCRGIG...
result:
wrong answer 1st lines differ - expected: 'GQREGLLIRSGLSCS', found: 'GQRGLLIRSGLSCS'