QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#133181#5660. Simplified Genome Translationtselmegkh#AC ✓1ms3596kbC++202.2kb2023-08-01 17:01:312023-08-01 17:02:17

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-01 17:02:17]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3596kb
  • [2023-08-01 17:01:31]
  • 提交

answer

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iomanip>
using namespace std;

const int N = 2e5 + 5, inf = 1e9;
#define pb push_back
#define mp make_pair
#define ll long long
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define sz(x) (int)x.size()
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;

map<string, char> d;
void solve(){
    string s;
    cin >> s;
    int n = sz(s);
    for(int i = 0; i < sz(s) - 2; i += 3){
        string t = s.substr(i, 3);
        char res = d[t];
        if(d[t] == '#')break;
        cout << d[t];
    }
    cout << '\n';
}

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

詳細信息

Test #1:

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

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

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

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