QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#102425#5660. Simplified Genome TranslationWPS#AC ✓2ms3456kbC++172.0kb2023-05-03 13:01:332023-05-03 13:01:35

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 13:01:35]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3456kb
  • [2023-05-03 13:01:33]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int maxn = 3e5+10;
const int mod = 1e9+7;
const int INF = 0x3f3f3f3f3f3f3f3f;
map<string,char>mp;
void solve(){
    string s , t;
    cin >> s;
    for( int i = 0 ; i < s.size() ; i += 3 ){
        t = s.substr( i , 3 );
        if( mp[t] == '*' ){
            cout << "\n";
            return;
        }
        cout << mp[t];
    }
    cout <<"\n";
}
void f(){
    mp["UUU"] = 'F';
    mp["UUA"] = 'L';
    mp["AUU"] = 'I';
    mp["AUG"] = 'M';
    mp["GUU"] = 'V';
    mp["UCU"] = 'S';
    mp["CCU"] = 'P';
    mp["ACU"] = 'T';
    mp["GCU"] = 'A';
    mp["UAU"] = 'Y';
    mp["CAU"] = 'H';
    mp["CAA"] = 'Q';
    mp["AAU"] = 'N';
    mp["AAA"] = 'K';
    mp["GAU"] = 'D';
    mp["GAA"] = 'E';
    mp["UGU"] = 'C';
    mp["UGG"] = 'W';
    mp["CGU"] = 'R';
    mp["GGU"] = 'G';

    mp["UUC"] = 'F';
    mp["UUG"] = 'L';
    mp["AUC"] = 'I';
    mp["GUC"] = 'V';
    mp["UCC"] = 'S';
    mp["CCC"] = 'P';
    mp["ACC"] = 'T';
    mp["GCC"] = 'A';
    mp["UAC"] = 'Y';
    mp["CAC"] = 'H';
    mp["CAG"] = 'Q';
    mp["AAC"] = 'N';
    mp["AAG"] = 'K';
    mp["GAC"] = 'D';
    mp["GAG"] = 'E';
    mp["UGC"] = 'C';
    mp["CGC"] = 'R';
    mp["GGC"] = 'G';

    mp["CUU"] = 'L';
    mp["AUA"] = 'I';
    mp["GUA"] = 'V';
    mp["UCA"] = 'S';
    mp["CCA"] = 'P';
    mp["ACA"] = 'T';
    mp["GCA"] = 'A';
    mp["CGA"] = 'R';
    mp["GGA"] = 'G';

    mp["CUC"] = 'L';
    mp["GUG"] = 'V';
    mp["UCG"] = 'S';
    mp["CCG"] = 'P';
    mp["ACG"] = 'T';
    mp["GCG"] = 'A';
    mp["CGG"] = 'R';
    mp["GGG"] = 'G';

    mp["UAA"] = '*';
    mp["UAG"] = '*';
    mp["UGA"] = '*';

    mp["CUG"] = 'L';
    mp["AGC"] = 'S';
    mp["AGG"] = 'R';
    mp["CUA"] = 'L';
    mp["AGU"] = 'S';
    mp["AGA"] = 'R';
}

int32_t main(){
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    f();

    int T=1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}


詳細信息

Test #1:

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

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 2ms
memory: 3456kb

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

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