QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#736434#5660. Simplified Genome TranslationSanguineChameleon#AC ✓1ms3776kbC++201.3kb2024-11-12 11:02:562024-11-12 11:03:00

Judging History

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

  • [2024-11-12 11:03:00]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3776kb
  • [2024-11-12 11:02:56]
  • 提交

answer

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

map<string, char> mp;

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

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

详细

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

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

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