QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#94845#5660. Simplified Genome Translationpedroteosousa#AC ✓3ms3632kbC++141.1kb2023-04-07 23:23:362023-04-07 23:23:48

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-07 23:23:48]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3632kb
  • [2023-04-07 23:23:36]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define maxn 100100

#define pb push_back

string S = "\
\
F UUU UUC \
L UUA UUG CUU CUC CUA CUG \
I AUU AUC AUA \
M AUG \
V GUU GUC GUA GUG \
S UCU UCC UCA UCG AGU AGC \
P CCU CCC CCA CCG \
T ACU ACC ACA ACG \
A GCU GCC GCA GCG \
Y UAU UAC \
H CAU CAC \
Q CAA CAG \
N AAU AAC \
K AAA AAG \
D GAU GAC \
E GAA GAG \
C UGU UGC \
W UGG \
R CGU CGC CGA CGG AGA AGG \
G GGU GGC GGA GGG \
Z UAA UAG UGA" ;

char str[maxn];

main(){

	map<string,char> mp;
	
	stringstream fin;
	
	fin << S;
	
	string a;
	char cur;
	while(fin >> a){
		//cout << a << endl;
		if(a.size() == 1) cur = a[0];
		else mp[a] = cur;
	}
	
	int nt;
	scanf("%d",&nt);
	while(nt--){
	
		int stp = 0;
		char a,b,c;
		
		scanf(" %s",str);
		int n = strlen(str);
		
		for(int i=0;i<n;i+=3){
			string s;
			s.pb(str[i]);
			s.pb(str[i+1]);
			s.pb(str[i+2]);
			char cur = mp[s];
			if(cur == 'Z') stp = 1;
			if(stp == 0) printf("%c",cur);
			//printf("%c %d\n",cur,stp);
		}
		printf("\n");
	}


}

詳細信息

Test #1:

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

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 3532kb

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: 3ms
memory: 3632kb

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