QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#117146 | #5660. Simplified Genome Translation | bakuganulit | AC ✓ | 11ms | 8000kb | Python3 | 973b | 2023-06-30 14:49:56 | 2023-06-30 14:49:59 |
Judging History
answer
hmap = {'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'], 'STOP': ['UAA', 'UAG', 'UGA']}
def solve():
k = input()
r = ""
for i in range(0, len(k), 3):
rna = k[i:i+3]
if rna in hmap["STOP"]:
break
for key, val in hmap.items():
if rna in val:
r += key
print(r)
if __name__ == "__main__":
t = int(input())
for i in range(t):
solve()
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 7ms
memory: 7976kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 11ms
memory: 8000kb
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: 1ms
memory: 7964kb
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