QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#213725#5660. Simplified Genome TranslationJeffrey#AC ✓1ms3864kbC++141.2kb2023-10-14 15:46:352023-10-14 15:46:35

Judging History

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

  • [2023-10-14 15:46:35]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3864kb
  • [2023-10-14 15:46:35]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <sstream>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

string a = "F UUU UUC\nL UUA UUG CUU CUC CUA CUG\nI AUU AUC AUA\nM AUG\nV GUU GUC GUA GUG\nS UCU UCC UCA UCG AGU AGC\nP CCU CCC CCA CCG\nT ACU ACC ACA ACG\nA GCU GCC GCA GCG\nY UAU UAC\nH CAU CAC\nQ CAA CAG\nN AAU AAC\nK AAA AAG\nD GAU GAC\nE GAA GAG\nC UGU UGC\nW UGG\nR CGU CGC CGA CGG AGA AGG\nG GGU GGC GGA GGG\n";

int main() {
    map<string, char> m;
    stringstream aa(a);
    string s;
    for (int i = 0; i < 20; i++) {
        getline(aa, s);
        stringstream ss(s);
        char c = '?';
        bool b = 0;
        while (ss >> s) {
            if (b) m[s] = c;
            else c = s[0];
            b = 1;
        }
    }
    m["UAA"] = m["UAG"] = m["UGA"] = '!';
    int t;
    cin >> t;
    while (t--) {
        string s, t;
        cin >> s;
        for (int i = 0; i < s.length(); i += 3) {
            t += m[s.substr(i, 3)];
            if (t.back() == '!') {
                t.pop_back();
                break;
            }
        }
        cout << t << '\n';
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
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: 3812kb

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

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