QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#104091#5660. Simplified Genome TranslationtarjenAC ✓1ms3412kbC++171.8kb2023-05-08 16:26:512023-05-08 16:26:52

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-08 16:26:52]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3412kb
  • [2023-05-08 16:26:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
map<string,char> a;
void init()
{
    a["UUU"] = 'F';
    a["UUC"] = 'F';

    a["UUA"] = 'L';
    a["UUG"] = 'L';
    a["CUU"] = 'L';
    a["CUC"] = 'L';
    a["CUA"] = 'L';
    a["CUG"] = 'L';

    a["AUU"] = 'I';
    a["AUC"] = 'I';
    a["AUA"] = 'I';

    a["AUG"] = 'M';

    a["GUU"] = 'V';
    a["GUC"] = 'V';
    a["GUA"] = 'V';
    a["GUG"] = 'V';

    a["UCU"] = 'S';
    a["UCC"] = 'S';
    a["UCA"] = 'S';
    a["UCG"] = 'S';
    a["AGU"] = 'S';
    a["AGC"] = 'S';

    a["CCU"] = 'P';
    a["CCC"] = 'P';
    a["CCA"] = 'P';
    a["CCG"] = 'P';

    a["ACU"] = 'T';
    a["ACC"] = 'T';
    a["ACA"] = 'T';
    a["ACG"] = 'T';

    a["GCU"] = 'A';
    a["GCC"] = 'A';
    a["GCA"] = 'A';
    a["GCG"] = 'A';

    a["UAU"] = 'Y';
    a["UAC"] = 'Y';

    a["CAU"] = 'H';
    a["CAC"] = 'H';

    a["CAA"] = 'Q';
    a["CAG"] = 'Q';

    a["AAU"] = 'N';
    a["AAC"] = 'N';

    a["AAA"] = 'K';
    a["AAG"] = 'K';

    a["GAU"] = 'D';
    a["GAC"] = 'D';

    a["GAA"] = 'E';
    a["GAG"] = 'E';

    a["UGU"] = 'C';
    a["UGC"] = 'C';

    a["UGG"] = 'W';

    a["CGU"] = 'R';
    a["CGC"] = 'R';
    a["CGA"] = 'R';
    a["CGG"] = 'R';
    a["AGA"] = 'R';
    a["AGG"] = 'R';

    a["GGU"] = 'G';
    a["GGC"] = 'G';
    a["GGA"] = 'G';
    a["GGG"] = 'G';

    a["UAA"] = '1';
    a["UAG"] = '1';
    a["UGA"] = '1';


}
int main()
{
    init();
    int T;
    cin >> T;
    string s;
    while (T--)
    {
        cin >> s;
        string s1;int z=s.length();
        for (int i=0;i<z;i+=3)
        {
            s1=s.substr(i,3);
            if (a[s1]=='1') break;
            cout << a[s1] ;
            
        }
        cout <<endl;
    }
    return 0;
}

详细

Test #1:

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

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: 3408kb

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: 3364kb

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