QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#102475#5660. Simplified Genome Translationshunn#AC ✓3ms3496kbC++202.4kb2023-05-03 13:44:102023-05-03 13:44:13

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 13:44:13]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3496kb
  • [2023-05-03 13:44:10]
  • 提交

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;
}

詳細信息

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