QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#626738#5660. Simplified Genome TranslationKowerKoint#AC ✓1ms3612kbC++201.3kb2024-10-10 12:17:202024-10-10 12:17:21

Judging History

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

  • [2024-10-10 12:17:21]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3612kb
  • [2024-10-10 12:17:20]
  • 提交

answer

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

int main() {
    map<char, string> mp;
    mp['F'] = "UUUUUC";
    mp['L'] = "UUAUUGCUUCUCCUACUG";
    mp['I'] = "AUUAUCAUA";
    mp['M'] = "AUG";
    mp['V'] = "GUUGUCGUAGUG";
    mp['S'] = "UCUUCCUCAUCGAGUAGC";
    mp['P'] = "CCUCCCCCACCG";
    mp['T'] = "ACUACCACAACG";
    mp['A'] = "GCUGCCGCAGCG";
    mp['Y'] = "UAUUAC";
    mp['H'] = "CAUCAC";
    mp['Q'] = "CAACAG";
    mp['N'] = "AAUAAC";
    mp['K'] = "AAAAAG";
    mp['D'] = "GAUGAC";
    mp['E'] = "GAAGAG";
    mp['C'] = "UGUUGC";
    mp['W'] = "UGG";
    mp['R'] = "CGUCGCCGACGGAGAAGG";
    mp['G'] = "GGUGGCGGAGGG";
    mp['$'] = "UAAUAGUGA";
    map<string, char> rmp;
    for(auto [k, v] : mp) {
        assert(ssize(v)%3 == 0);
        for(int i = 0; i < ssize(v); i += 3) {
            string vv = v.substr(i, 3);
            assert(!rmp.count(vv));
            rmp[vv]= k;
        }
    }
    int t; cin >> t;
    while(t--) {
        string s; cin >> s;
        string t;
        for(int i = 0; i < ssize(s); i += 3) {
            string ss = s.substr(i, 3);
            assert(rmp.count(ss));
            t += rmp[ss];
            if(t.back() == '$') {
                t.pop_back();
                break;
            }
        }
        cout << t << '\n';
    }
}

詳細信息

Test #1:

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

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

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

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