QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#113651#5660. Simplified Genome TranslationUFRJ#AC ✓1ms3504kbC++201.7kb2023-06-19 02:18:572023-06-19 02:19:00

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-19 02:19:00]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3504kb
  • [2023-06-19 02:18:57]
  • 提交

answer

#include<bits/stdc++.h>

int main() {
	using namespace std;
	cin.tie(nullptr)->sync_with_stdio(false);
	map<string, string> tab;
	tab["UUU"] = 'F';
	tab["UUC"] = 'F';
	tab["UUA"] = 'L';
	tab["UUG"] = 'L';
	tab["CUU"] = 'L';
	tab["CUC"] = 'L';
	tab["CUA"] = 'L';
	tab["CUG"] = 'L';

	tab["AUU"] = 'I';
	tab["AUC"] = 'I';
	tab["AUA"] = 'I';
	tab["AUG"] = 'M';
	
	tab["GUU"] = 'V';
	tab["GUC"] = 'V';
	tab["GUA"] = 'V';
	tab["GUG"] = 'V';
	
	tab["UCU"] = 'S';
	tab["UCC"] = 'S';
	tab["UCA"] = 'S';
	tab["UCG"] = 'S';
	tab["AGU"] = 'S';
	tab["AGC"] = 'S';

	tab["CCU"] = 'P';
	tab["CCC"] = 'P';
	tab["CCA"] = 'P';
	tab["CCG"] = 'P';
	
	tab["ACU"] = 'T';
	tab["ACC"] = 'T';
	tab["ACA"] = 'T';
	tab["ACG"] = 'T';


	tab["GCU"] = 'A';
	tab["GCC"] = 'A';
	tab["GCA"] = 'A';
	tab["GCG"] = 'A';
	
	tab["UAU"] = 'Y';
	tab["UAC"] = 'Y';
	
	tab["CAU"] = 'H';
	tab["CAC"] = 'H';
	
	tab["CAA"] = 'Q';
	tab["CAG"] = 'Q';
	
	tab["AAU"] = 'N';
	tab["AAC"] = 'N';
	
	tab["AAA"] = 'K';
	tab["AAG"] = 'K';
	
	tab["GAU"] = 'D';
	tab["GAC"] = 'D';
	
	tab["GAA"] = 'E';
	tab["GAG"] = 'E';
	
	tab["UGU"] = 'C';
	tab["UGC"] = 'C';
	
	tab["UGG"] = 'W';

	tab["CGU"] = 'R';
	tab["CGC"] = 'R';
	tab["CGA"] = 'R';
	tab["CGG"] = 'R';
	tab["AGA"] = 'R';
	tab["AGG"] = 'R';
	
	tab["GGU"] = 'G';
	tab["GGC"] = 'G';
	tab["GGA"] = 'G';
	tab["GGG"] = 'G';
	tab["UAA"] = "STOP";
	tab["UAG"] = "STOP";
	tab["UGA"] = "STOP";

	int T; cin >> T;

	while (T--) {
		string S; cin >> S;
		int N = int(S.size());
		
		for (int a = 0; a < N; a += 3) {
			if (tab[S.substr(a, 3)] == "STOP") break;
			cout << tab[S.substr(a, 3)];
		}

		cout << '\n';
	}
}

详细

Test #1:

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

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

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

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