QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#549695#5660. Simplified Genome TranslationTiga_Pilot_2#AC ✓1ms3632kbC++201.5kb2024-09-06 19:42:202024-09-06 19:42:20

Judging History

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

  • [2024-09-06 19:42:20]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3632kb
  • [2024-09-06 19:42:20]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(a, b) for (int i = (int) a; i < (int) b; i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

int main() { 
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    map<string, string> mpx = {
        {"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"},
        {"", "UAA UAG UGA"}
    };

    map<string, string> mpy;
    for(auto [p, q]: mpx) {
        stringstream ss(q);
        string s;
        while(ss >> s) {
            mpy[s] = p;
        }
    }
    int T;
    cin >> T;
    while(T--) {
        string s;
        cin >> s;
        for(int i=0; i<s.size(); i+=3) {
            string t = s.substr(i, 3);
            if(mpy[t] == "") {
                break;
            }
            cout << mpy[t];
        }
        cout << "\n";
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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: 0ms
memory: 3632kb

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