QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#184512#5660. Simplified Genome TranslationAnwar#AC ✓1ms3540kbC++231.1kb2023-09-20 20:24:302023-09-20 20:24:31

Judging History

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

  • [2023-09-20 20:24:31]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3540kb
  • [2023-09-20 20:24:30]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

const int N = 1e3 + 5 , MOD = 1e9 + 7 ;


int main()
{
    cin.tie(0);cin.sync_with_stdio(0);
    cout.tie(0);cout.sync_with_stdio(0);


    map< string , char > mp ;

    string a[] = {"FUUUUUC", "LUUAUUGCUUCUCCUACUG", "IAUUAUCAUA", "MAUG", "VGUUGUCGUAGUG", "SUCUUCCUCAUCGAGUAGC", "PCCUCCCCCACCG", "TACUACCACAACG", "AGCUGCCGCAGCG", "YUAUUAC", "HCAUCAC", "QCAACAG", "NAAUAAC", "KAAAAAG", "DGAUGAC", "EGAAGAG", "CUGUUGC", "WUGG", "RCGUCGCCGACGGAGAAGG", "GGGUGGCGGAGGG"} ;


    for(string s : a)
    {
        for(int i = 1 ; i < (int)s.size() ; i += 3)
        {
            mp[s.substr(i , 3)] = s[0] ;
        }
    }


    int t= 1;
    cin >> t;
    while (t--)
    {
        string s ;
        cin >> s;

        for(int i =0 ; i < (int)s.size() ; i += 3)
        {
            if( mp.find(s.substr( i , 3)) != mp.end() ) cout << mp[s.substr(i , 3)] ;
            else{
                cout << "\n" ;
                break;
            }

            if(i+3 == (int)s.size()) cout << "\n";
        }
    }

    return 0;
}

详细

Test #1:

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

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

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: 1ms
memory: 3536kb

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