QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#238756#5660. Simplified Genome TranslationItsJerr#AC ✓0ms3856kbC++201.5kb2023-11-04 17:26:312023-11-04 17:26:31

Judging History

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

  • [2023-11-04 17:26:31]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3856kb
  • [2023-11-04 17:26:31]
  • 提交

answer

/*input
5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

*/
#include <bits/stdc++.h>

using namespace std;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	int t;
	cin >> t;
	while (t-- > 0)
	{
		string s;
		cin >> s;
		int n = s.size();
		s = ' ' + s;
		n /= 3;
		for (int i = 1; i <= n; ++i)
		{
			string t = s.substr((i - 1) * 3 + 1, 3);
			if(t=="UUU"||t=="UUC") cout << "F";
			else if(t=="UUA"||t=="UUG"||t=="CUU"||t=="CUA"||t=="CUG"||t=="CUC") cout << "L";
			else if(t=="AUU"||t=="AUC"||t=="AUA") cout << "I";
			else if(t=="AUG") cout << "M";
			else if(t=="GUU"||t=="GUA"||t=="GUC"||t=="GUG") cout << "V";
			else if(t=="UCU"||t=="UCC"||t=="UCA"||t=="UCG"||t=="AGU"||t=="AGC") cout << "S";
			else if(t=="CCU"||t=="CCC"||t=="CCA"||t=="CCG") cout << "P";
			else if(t=="ACU"||t=="ACA"||t=="ACG"||t=="ACC") cout << "T";
			else if(t=="GCU"||t=="GCC"||t=="GCA"||t=="GCG") cout << "A";
			else if(t=="UAU"||t=="UAC") cout  << "Y";
			else if(t=="CAU"||t=="CAC") cout << "H";
			else if(t=="CAA"||t=="CAG") cout<< "Q";
			else if(t=="AAU"||t=="AAC") cout << "N";
			else if(t=="AAA"||t=="AAG") cout << "K";
			else if(t=="GAU"||t=="GAC") cout << "D";
			else if(t=="GAA"||t=="GAG") cout << "E";
			else if(t=="UGU"||t=="UGC") cout << "C";
			else if(t=="UGG") cout << "W";
			else if(t=="CGU"||t=="CGC"||t=="CGA"||t=="CGG"||t=="AGA"||t=="AGG") cout<< 'R';
			else if(t=="GGU"||t=="GGC"||t=="GGA"||t=="GGG") cout << "G";
			else break;
		}
		cout << '\n';
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

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: 0ms
memory: 3856kb

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