QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#110340#5660. Simplified Genome Translationycccc319#AC ✓4ms3460kbC++201.2kb2023-06-01 16:30:362023-06-01 16:52:37

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-01 16:52:37]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3460kb
  • [2023-06-01 16:30:36]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
vector<string> a{
        {"UUUUUC"},
        {"UUAUUGCUUCUCCUACUG"},
        {"AUUAUCAUA"},
        {"AUG"},
        {"GUUGUCGUAGUG"},
        {"UCUUCCUCAUCGAGUAGC"},
        {"CCUCCCCCACCG"},
        {"ACUACCACAACG"},
        {"GCUGCCGCAGCG"},
        {"UAUUAC"},
        {"CAUCAC"},
        {"CAACAG"},
        {"AAUAAC"},
        {"AAAAAG"},
        {"GAUGAC"},
        {"GAAGAG"},
        {"UGUUGC"},
        {"UGG"},
        {"CGUCGCCGACGGAGAAGG"},
        {"GGUGGCGGAGGG"},
        {"UAAUAGUGA"}
};
const char* s = "FLIMVSPTAYHQNKDECWRG";
int main() {
    int T;
    cin>>T;
    while (T--)
    {
        string h,ret;cin >> h;
        for(int i = 0;i < h.size();) {
            for(int j = 0;j < a.size(); ++j) {
                for(int k = 0;k < a[j].size(); k += 3) {
                    if(h.substr(i,3) == a[j].substr(k,3)) {
                        char c = s[j];
                        if(!c)i = INT32_MAX;
                        else i += 3, ret += c;
                        break;
                    }
                }
            }
        }
        cout << ret << '\n';
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3388kb

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

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: 4ms
memory: 3388kb

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