QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#505848#5660. Simplified Genome TranslationUESTC_DECAYALI#AC ✓1ms3580kbC++171.3kb2024-08-05 12:27:232024-08-05 12:27:24

Judging History

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

  • [2024-08-05 12:27:24]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3580kb
  • [2024-08-05 12:27:23]
  • 提交

answer

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

詳細信息

Test #1:

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

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

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

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