QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#132287#5660. Simplified Genome Translationwillow#AC ✓2ms3596kbC++141.3kb2023-07-29 13:16:032023-07-29 13:16:07

Judging History

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

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

answer

#include<bits/stdc++.h>
using namespace std;
map<string, string> to;
string s, ans;
int T;
int main() {
	to["UUU"] = to["UUC"] = "F";
	to["UUA"] = to["UUG"] = to["CUU"] = to["CUC"] = to["CUA"] = to["CUG"] = "L";
	to["AUU"] = to["AUC"] = to["AUA"] = "I";
	to["AUG"] = "M";
	to["GUU"] = to["GUC"] = to["GUA"] = to["GUG"] = "V";
	to["UCU"] = to["UCC"] = to["UCA"] = to["UCG"] = to["AGU"] = to["AGC"] = "S";
	to["CCU"] = to["CCC"] = to["CCA"] = to["CCG"] = "P";
	to["ACU"] = to["ACC"] = to["ACA"] = to["ACG"] = "T";
	to["GCU"] = to["GCC"] = to["GCA"] = to["GCG"] = "A";
	to["UAU"] = to["UAC"] = "Y";
	to["CAU"] = to["CAC"] = "H";
	to["CAA"] = to["CAG"] = "Q";
	to["AAU"] = to["AAC"] = "N";
	to["AAA"] = to["AAG"] = "K";
	to["GAU"] = to["GAC"] = "D";
	to["GAA"] = to["GAG"] = "E";
	to["UGU"] = to["UGC"] = "C";
	to["UGG"] = "W";
	to["CGU"] = to["CGC"] = to["CGA"] = to["CGG"] = to["AGA"] = to["AGG"] = "R";
	to["GGU"] = to["GGC"] = to["GGA"] = to["GGG"] = "G";
	to["UAA"] = to["UAG"] = to["UGA"] = "stop";
	ios :: sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	for(cin >> T; T --; ) {
		cin >> s;
		int n = s.length();
		ans = "";
		for(int i = 0; i < n; i += 3) {
			string now = s.substr(i, 3);
			now = to[now];
			if(now == "stop")
				break;
			ans += now;
		}
		cout << ans << endl;
	}
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3452kb

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

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: 2ms
memory: 3596kb

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