QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#677510#5660. Simplified Genome TranslationForever_Young#AC ✓1ms3708kbC++231.5kb2024-10-26 12:25:212024-10-26 12:25:22

Judging History

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

  • [2024-10-26 12:25:22]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3708kb
  • [2024-10-26 12:25:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define data dataa
using LL=long long;
using ULL=unsigned long long;
using LD=long double;
#define gcd(x,y) __gcd(unsigned(x),unsigned(y))
map<string,char>dic;
int main()
{
    dic["UUU"]=dic["UUC"]='F';
    dic["UUA"]=dic["UUG"]=dic["CUU"]=dic["CUC"]=dic["CUA"]=dic["CUG"]='L';
    dic["AUU"]=dic["AUC"]=dic["AUA"]='I';
    dic["AUG"]='M';
    dic["GUU"]=dic["GUC"]=dic["GUA"]=dic["GUG"]='V';
    dic["UCU"]=dic["UCC"]=dic["UCA"]=dic["UCG"]=dic["AGU"]=dic["AGC"]='S';
    dic["CCU"]=dic["CCC"]=dic["CCA"]=dic["CCG"]='P';
    dic["ACU"]=dic["ACC"]=dic["ACA"]=dic["ACG"]='T';
    dic["GCU"]=dic["GCC"]=dic["GCA"]=dic["GCG"]='A';
    dic["UAU"]=dic["UAC"]='Y';
    dic["CAU"]=dic["CAC"]='H';
    dic["CAA"]=dic["CAG"]='Q';
    dic["AAU"]=dic["AAC"]='N';
    dic["AAA"]=dic["AAG"]='K';
    dic["GAU"]=dic["GAC"]='D';
    dic["GAA"]=dic["GAG"]='E';
    dic["UGU"]=dic["UGC"]='C';
    dic["UGG"]='W';
    dic["CGU"]=dic["CGC"]=dic["CGA"]=dic["CGG"]=dic["AGA"]=dic["AGG"]='R';
    dic["GGU"]=dic["GGC"]=dic["GGA"]=dic["GGG"]='G';
    dic["UAA"]=dic["UAG"]=dic["UGA"]='#';
    int T;
    for(scanf("%d",&T);T--;)
    {
        char s[1010];
        scanf("%s",s+1);
        int n=strlen(s+1);
        for(int i=1;i<=n;i+=3)
        {
            string a="";
            rep(j,3)a+=s[i+j-1];
            if(dic[a]=='#')break;
            putchar(dic[a]);
        }
        puts("");
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3608kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3652kb

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: 1ms
memory: 3708kb

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