QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#94847#5660. Simplified Genome TranslationSEM_PRESSAO_pedroteosousa#AC ✓2ms3476kbC++231.5kb2023-04-07 23:32:042023-04-07 23:32:08

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-07 23:32:08]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3476kb
  • [2023-04-07 23:32:04]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define int ll
#define all(v) v.begin(),v.end()
#define pb push_back

void dbg_out() {cerr << endl; }
template< typename H, typename... T> 
void dbg_out(H h, T... t) { cerr << ' ' << h; dbg_out(t...); }
#define dbg(...) { cerr << #__VA_ARGS__ << ':'; dbg_out(__VA_ARGS__); }

map<string, string> M;

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

void solve() {
	string str; cin >> str;
	int n = (int) str.size();
	for(int i = 0; i < n; i += 3) {
		string cur = str.substr(i, 3);
		if(M[cur] == "STOP") break;
		cout << M[cur];
	}
	cout << "\n";
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	prec();
	int t; cin >> t;
	while(t--)
		solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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

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