QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#124168#5660. Simplified Genome TranslationIanPauloAC ✓2ms3492kbC++141.1kb2023-07-14 11:22:402023-07-14 11:22:43

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-14 11:22:43]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3492kb
  • [2023-07-14 11:22:40]
  • 提交

answer

#include <iostream>
#include <string.h>
using namespace std;

string translate(string s){
	string i = "UCAG";
	int v = i.find(s[2]) + i.find(s[1])*16 + i.find(s[0])*4;
	if(v==34 || v==35 || v==50)
		return "STOP";
	else if(v<=1)
		return "F";
	else if(v<=7)
		return "L";
	else if(v<=10)
		return "I";
	else if(v==11)
		return "M";
	else if(v<=15)
		return "V";
	else if(v<=19 || v==56 || v==57)
		return "S";
	else if(v<=23)
		return "P";
	else if(v<=27)
		return "T";
	else if(v<=31)
		return "A";
	else if(v<=33)
		return "Y";
	else if(v<=37)
		return "H";
	else if(v<=39)
		return "Q";
	else if(v<=41)
		return "N";
	else if(v<=43)
		return "K";
	else if(v<=45)
		return "D";
	else if(v<=47)
		return "E";
	else if(v<=49)
		return "C";
	else if(v==50)
		return "STOP";
	else if(v==51)
		return "W";
	else if(v<=59)
		return "R";
	else
		return "G";
}

string div(string seq){
	string r = "";
	while(seq!=""){
		string a = translate(seq.substr(0,3));
		if(a=="STOP")
			break;
		r.append(a);
		seq.erase(0,3);
	}
	return r;
}

int main(){
	int t;
	cin >> t;
	for(int i=0;i<t;i++){
		string seq;
		cin >> seq;
		cout << div(seq) <<endl;
	}

}

詳細信息

Test #1:

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

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

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