QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#548746#5660. Simplified Genome Translationskrghariapa#AC ✓1ms3624kbC++172.0kb2024-09-05 20:34:502024-09-05 20:34:52

Judging History

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

  • [2024-09-05 20:34:52]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3624kb
  • [2024-09-05 20:34:50]
  • 提交

answer

#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
using ll = long long;

int main(){
    map<string, string> mp;
    mp["UUC"] = "F";
    mp["UUU"] = "F";
    mp["UUA"] = "L";
    mp["UUG"] = "L";
    mp["CUU"] = "L";
    mp["CUC"] = "L";
    mp["CUA"] = "L";
    mp["CUG"] = "L";
    mp["AUU"] = "I";
    mp["AUC"] = "I";
    mp["AUA"] = "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["UCG"] = "S";
    mp["AGU"] = "S";
    mp["AGC"] = "S";
    mp["CCU"] = "P";
    mp["CCC"] = "P";
    mp["CCA"] = "P";
    mp["CCG"] = "P";
    mp["ACU"] = "T";
    mp["ACC"] = "T";
    mp["ACA"] = "T";
    mp["ACG"] = "T";
    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["AAU"] = "N";
    mp["AAC"] = "N";
    mp["AAA"] = "K";
    mp["AAG"] = "K";
    mp["GAU"] = "D";
    mp["GAC"] = "D";
    mp["GAA"] = "E";
    mp["GAG"] = "E";
    mp["UGU"] = "C";
    mp["UGC"] = "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";
    mp["UAA"] = "STOP";
    mp["UAG"] = "STOP";
    mp["UGA"] = "STOP";

    int t;
    string s, stemp, temp, ans;
    cin>>t;
    while(t--){
        ans = "";
        cin>>s;
        for(int i = 0; i <s.length(); i+=3){
            stemp = string() + s[i]+s[i+1]+s[i+2];
            temp = mp[stemp];
            if(temp == "STOP"){
                break;
            }
            else{
                ans += temp;
            }
        }
        cout<<ans<<endl;
    }
}

详细

Test #1:

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

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

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

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