QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#84100#5660. Simplified Genome TranslationHOLIC#AC ✓2ms3500kbC++201.6kb2023-03-05 14:09:342023-03-05 14:09:36

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-05 14:09:36]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3500kb
  • [2023-03-05 14:09:34]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1009;
int fa[N];
map<string, string> vis;
string s;
void work() {
    cin >> s;
    for(int i = 0; i < s.size(); i += 3) {
        string a = "";
        a += s[i];
        a += s[i + 1];
        a += s[i + 2];
        if(vis[a] == "STOP") break;
        else cout << vis[a];
    }
    cout << endl;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int Case = 1;
    vis["UUU"] = vis["UUC"] = "F";
    vis["UUA"] = vis["UUG"] = vis["CUU"] = vis["CUC"] = vis["CUA"] = vis["CUG"] = "L";
    vis["AUU"] = vis["AUC"] = vis["AUA"] = "I";
    vis["AUG"] = "M";
    vis["GUU"] = vis["GUC"] = vis["GUA"] = vis["GUG"] = "V";
    vis["UCU"] = vis["UCC"] = vis["UCA"] = vis["UCG"] = vis["AGU"] = vis["AGC"] = "S";
    vis["CCU"] = vis["CCC"] = vis["CCA"] = vis["CCG"] = "P";
    vis["ACU"] = vis["ACC"] = vis["ACA"] = vis["ACG"] = "T";
    vis["GCU"] = vis["GCC"] = vis["GCA"] = vis["GCG"] = "A";
    vis["UAU"] = vis["UAC"] = "Y";
    vis["CAU"] = vis["CAC"] = "H";
    vis["CAA"] = vis["CAG"] = "Q";
    vis["AAU"] = vis["AAC"] = "N";
    vis["AAA"] = vis["AAG"] = "K";
    vis["GAU"] = vis["GAC"] = "D";
    vis["GAA"] = vis["GAG"] = "E";
    vis["UGU"] = vis["UGC"] = "C";
    vis["UGG"] = "W";
    vis["CGU"] = vis["CGC"] = vis["CGA"] = vis["CGG"] = vis["AGA"] = vis["AGG"] = "R";
    vis["GGU"] = vis["GGC"] = vis["GGA"] = vis["GGG"] = "G";
    vis["UAA"] = vis["UAG"] = vis["UGA"] = "STOP";
    cin >> Case;
    while(Case --) work();
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3444kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3500kb

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: 2ms
memory: 3400kb

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