QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#205972#5660. Simplified Genome TranslationdkdkAC ✓0ms3892kbC++202.3kb2023-10-07 17:59:222023-10-07 18:01:27

Judging History

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

  • [2023-10-07 18:01:27]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3892kb
  • [2023-10-07 17:59:22]
  • 提交

answer

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <cmath>
#include <string>
#include <set>
#include <iomanip>
#define ft first
#define sd second
#define endl '\n'
#define lowbit(x) (x & (-x))
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using i128 = __int128;
const int N = 1010, mod = 998244353, INF = 2147483647;
int dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1};

map<string, char> m;

void solve()
{
    string s, ans = "";
    cin >> s;
    for(int i = 0; i <= s.length() - 3 ; i += 3)
    {
        string tmp = s.substr(i, 3);
        char wd = m[tmp];
        if(wd == 'p')break;
        else ans += wd;
    }
    cout << ans << endl;
}

signed main()
{
    m["UUU"] = 'F';
    m["UUC"] = 'F';
    m["UUA"] = 'L';
    m["UUG"] = 'L';
    m["CUU"] = 'L';
    m["CUC"] = 'L';
    m["CUA"] = 'L';
    m["CUG"] = 'L';
    m["AUU"] = 'I';
    m["AUC"] = 'I';
    m["AUA"] = 'I';
    m["AUG"] = 'M';
    m["GUU"] = 'V';
    m["GUC"] = 'V';
    m["GUA"] = 'V';
    m["GUG"] = 'V';
    m["UCU"] = 'S';
    m["UCC"] = 'S';
    m["UCA"] = 'S';
    m["UCG"] = 'S';
    m["AGU"] = 'S';
    m["AGC"] = 'S';
    m["CCU"] = 'P';
    m["CCC"] = 'P';
    m["CCA"] = 'P';
    m["CCG"] = 'P';
    m["ACU"] = 'T';
    m["ACC"] = 'T';
    m["ACA"] = 'T';
    m["ACG"] = 'T';
    m["GCU"] = 'A';
    m["GCC"] = 'A';
    m["GCA"] = 'A';
    m["GCG"] = 'A';
    m["UAU"] = 'Y';
    m["UAC"] = 'Y';
    m["CAU"] = 'H';
    m["CAC"] = 'H';
    m["CAA"] = 'Q';
    m["CAG"] = 'Q';
    m["AAU"] = 'N';
    m["AAC"] = 'N';
    m["AAA"] = 'K';
    m["AAG"] = 'K';
    m["GAU"] = 'D';
    m["GAC"] = 'D';
    m["GAA"] = 'E';
    m["GAG"] = 'E';
    m["UGU"] = 'C';
    m["UGC"] = 'C';
    m["UGG"] = 'W';
    m["CGU"] = 'R';
    m["CGC"] = 'R';
    m["CGA"] = 'R';
    m["CGG"] = 'R';
    m["AGA"] = 'R';
    m["AGG"] = 'R';
    m["GGU"] = 'G';
    m["GGC"] = 'G';
    m["GGA"] = 'G';
    m["GGG"] = 'G';
    m["UAA"] = 'p';
    m["UAG"] = 'p';
    m["UGA"] = 'p';

    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t = 1;
    cin >> t;
    while(t -- )solve();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3892kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3672kb

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

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