QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#186192#5660. Simplified Genome TranslationBUET_POTATOES#AC ✓1ms3592kbC++201.2kb2023-09-23 12:37:032023-09-23 12:37:03

Judging History

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

  • [2023-09-23 12:37:03]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3592kb
  • [2023-09-23 12:37:03]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

string dataset = "F UUU UUC \
L UUA UUG CUU CUC CUA CUG \
I AUU AUC AUA \
M AUG \
V GUU GUC GUA GUG \
S UCU UCC UCA UCG AGU AGC \
P CCU CCC CCA CCG \
T ACU ACC ACA ACG \
A GCU GCC GCA GCG \
Y UAU UAC \
H CAU CAC \
Q CAA CAG \
N AAU AAC \
K AAA AAG \
D GAU GAC \
E GAA GAG \
C UGU UGC \
W UGG \
R CGU CGC CGA CGG AGA AGG \
G GGU GGC GGA GGG \
STOP UAA UAG UGA";

map<string, string>mp;

void parseshit(){
    string temp;
    stringstream ss(dataset);
    string curAcid;
    while(getline(ss,temp, ' '))
    {
        if(temp.size()!=3){
            curAcid = temp;
        }
        else{
            mp[temp] = curAcid;
        }
    }
}

void solv(int ces){
    string s;
    cin>>s;
    string ans;
    for(int i=0; i<s.size(); i+=3){
        string cur = s.substr(i, 3);
        string ret = mp[cur];
        if(ret.size()!=1) break;
        ans += ret;
    }
    cout<<ans<<"\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    parseshit();

    int tc = 1;
    cin>>tc;
    for(int ces=1; ces<=tc; ces++){
        solv(ces);
    }

    return 0;
}


詳細信息

Test #1:

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

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

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

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