QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#103474 | #5660. Simplified Genome Translation | cardinal_city# | AC ✓ | 16ms | 8156kb | Python3 | 1.2kb | 2023-05-06 03:02:49 | 2023-05-06 03:02:53 |
Judging History
answer
tns = {
"F": "UUU UUC".split(" "),
"L": "UUA UUG CUU CUC CUA CUG".split(" "),
"I": "AUU AUC AUA".split(" "),
"M": "AUG".split(" "),
"V": "GUU GUC GUA GUG".split(" "),
"S": "UCU UCC UCA UCG AGU AGC".split(" "),
"P": "CCU CCC CCA CCG".split(" "),
"T": "ACU ACC ACA ACG".split(" "),
"A": "GCU GCC GCA GCG".split(" "),
"Y": "UAU UAC".split(" "),
"H": "CAU CAC".split(" "),
"Q": "CAA CAG".split(" "),
"N": "AAU AAC".split(" "),
"K": "AAA AAG".split(" "),
"D": "GAU GAC".split(" "),
"E": "GAA GAG".split(" "),
"C": "UGU UGC".split(" "),
"W": "UGG".split(" "),
"R": "CGU CGC CGA CGG AGA AGG".split(" "),
"G": "GGU GGC GGA GGG".split(" "),
"STOP": "UAA UAG UGA".split(" ")
}
bmap = {}
for k, v in tns.items():
for a in v:
bmap[a] = k
# print(bmap)
def solve(inp):
outp = ""
for i in range(0, len(inp), 3):
k = inp[i:i+3]
if k not in bmap:
break
elif bmap[k] == "STOP":
break
outp += bmap[k]
return outp
anss = []
tc = int(input())
for i in range(tc):
inp = input()
anss.append(solve(inp))
print("\n".join(anss))
詳細信息
Test #1:
score: 100
Accepted
time: 11ms
memory: 8156kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 16ms
memory: 8052kb
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: 7ms
memory: 8148kb
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