QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#278822#5660. Simplified Genome Translationdat#RE 0ms0kbPython3924b2023-12-07 21:00:542023-12-07 21:00:54

Judging History

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

  • [2023-12-07 21:00:54]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-12-07 21:00:54]
  • 提交

answer

import sys
sys.stdin = open("input.txt", "r")
sys.stdout = open("output.txt", "w")

n = int(input())

ra = """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"""

m = [(e.split()[0], e.split()[1:]) for e in ra.split('\n')]
m = dict(m)

for _ in range(n):
    s = input()

    is_done = False
    for i in range(len(s)//3 + 1):
        sub_s = s[3*i:3*(i + 1)]
        for p, k in m.items():
            if sub_s in k:
                if p == "STOP":
                    is_done = True
                    break;         
                print(p, end='')
        if is_done:
            break
    print()
        
        


详细

Test #1:

score: 0
Dangerous Syscalls

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:


result: