QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#183882 | #5660. Simplified Genome Translation | ZiadElGafy# | WA | 1ms | 3896kb | C++20 | 2.2kb | 2023-09-19 22:48:12 | 2023-09-19 22:48:12 |
Judging History
answer
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define el '\n'
#define F first
#define S second
typedef long long ll;
typedef long double ld;
typedef __int128 bigInt;
using namespace std;
const int N = 4e5 + 5, INF = 1e9 + 5, mod = 1e9 + 7, LOG = 21, SQ = 500;
map<string, char> mp;
void doWork() {
string s, t = "";
cin >> s;
int n = s.size();
for (int i = 0; i < n; i += 3) {
string cur = "";
cur += s[i];
cur += s[i + 1];
cur += s[i + 2];
t += mp[cur];
if (t.back() == '*') {
t.pop_back();
return cout << t << el, void();
}
}
cout << t << el;
}
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
mp["UUU"] = 'F';
mp["UUC"] = 'F';
mp["UUA"] = 'L';
mp["UUG"] = 'L';
mp["CUU"] = 'L';
mp["CUC"] = 'L';
mp["CUA"] = 'L';
mp["CUG"] = 'L';
mp["AUU"] = 'I';
mp["AUC"] = 'I';
mp["AUA"] = 'I';
mp["AUG"] = 'M';
mp["GUU"] = 'V';
mp["GUC"] = 'V';
mp["GUA"] = 'V';
mp["GUG"] = 'V';
mp["UCU"] = 'S';
mp["UCC"] = 'S';
mp["UCA"] = 'S';
mp["UCG"] = 'S';
mp["AGU"] = 'S';
mp["AGC"] = 'S';
mp["CCU"] = 'P';
mp["CCC"] = 'P';
mp["CCA"] = 'P';
mp["CCG"] = 'P';
mp["ACU"] = 'T';
mp["ACC"] = 'T';
mp["ACA"] = 'T';
mp["ACG"] = 'T';
mp["GCU"] = 'A';
mp["GCC"] = 'A';
mp["GCA"] = 'A';
mp["GCG"] = 'A';
mp["UAU"] = 'Y';
mp["UAC"] = 'Y';
mp["CAU"] = 'H';
mp["CAC"] = 'H';
mp["CAA"] = 'Q';
mp["CAG"] = 'Q';
mp["AAU"] = 'N';
mp["AAC"] = 'N';
mp["AAA"] = 'K';
mp["AAG"] = 'K';
mp["GAU"] = 'D';
mp["GAC"] = 'D';
mp["GAA"] = 'E';
mp["GAG"] = 'E';
mp["UGU"] = 'C';
mp["UGC"] = 'C';
mp["UGG"] = 'W';
mp["CGU"] = 'R';
mp["CGC"] = 'R';
mp["CGA"] = 'R';
mp["CGG"] = 'R';
mp["AGA"] = 'R';
mp["GGU"] = 'G';
mp["GGC"] = 'G';
mp["GGA"] = 'G';
mp["GGG"] = 'G';
mp["UAA"] = '*';
mp["UAG"] = '*';
mp["UGA"] = '*';
int tests = 1;
cin >> tests;
for (int i = 1; i <= tests; i++) {
doWork();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3632kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3896kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQ
result:
wrong answer 1st lines differ - expected: 'GQREGLLIRSGLSCS', found: 'GQ'