QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#95685#5660. Simplified Genome TranslationSGColin#AC ✓2ms3056kbC++141.1kb2023-04-11 13:09:542023-04-11 13:09:56

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-11 13:09:56]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3056kb
  • [2023-04-11 13:09:54]
  • 提交

answer

#include<map>
#include<string>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1000;

int te,n;char s[maxn+5];
map<string,char> f;
string t;

int main(){
	f["UUU"]=f["UUC"]='F';
	f["UUA"]=f["UUG"]=f["CUU"]=f["CUC"]=f["CUA"]=f["CUG"]='L';
	f["AUU"]=f["AUC"]=f["AUA"]='I';
	f["AUG"]='M';
	f["GUU"]=f["GUC"]=f["GUA"]=f["GUG"]='V';
	f["UCU"]=f["UCC"]=f["UCA"]=f["UCG"]=f["AGU"]=f["AGC"]='S';
	f["CCU"]=f["CCC"]=f["CCA"]=f["CCG"]='P';
	f["ACU"]=f["ACC"]=f["ACA"]=f["ACG"]='T';
	f["GCU"]=f["GCC"]=f["GCA"]=f["GCG"]='A';
	f["UAU"]=f["UAC"]='Y';
	f["CAU"]=f["CAC"]='H';
	f["CAA"]=f["CAG"]='Q';
	f["AAU"]=f["AAC"]='N';
	f["AAA"]=f["AAG"]='K';
	f["GAU"]=f["GAC"]='D';
	f["GAA"]=f["GAG"]='E';
	f["UGU"]=f["UGC"]='C';
	f["UGG"]='W';
	f["CGU"]=f["CGC"]=f["CGA"]=f["CGG"]=f["AGA"]=f["AGG"]='R';
	f["GGU"]=f["GGC"]=f["GGA"]=f["GGG"]='G';
	f["UAA"]=f["UAG"]=f["UGA"]=0;
	for (scanf("%d",&te);te;te--){
		scanf("%s",s+1);n=strlen(s+1);
		for (int i=1;i<=n;i+=3){
			t=s[i];t+=s[i+1];t+=s[i+2];
			if (f[t]==0) break;
			putchar(f[t]);
		}
		puts("");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 2968kb

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

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

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