[Python] UVa problem 458 - The Decoder python runtime error

Discussão em 'Python' iniciado por Stack, Fevereiro 7, 2025.

  1. Stack

    Stack Membro Participativo

    So, this is the problem https://i.sstatic.net/2qaVn.png

    This is my code.

    while True:
    try:
    code = input()
    except EOFError:
    break
    if len(code) == 0:
    continue
    decode = ''
    for i in code:
    decode += chr(ord(i) - 7)

    print(decode)


    Example Input:

    [opz'pz'h'x|p{l'zpunsl'wyvislt5
    PM'`V\'HYL'YLHKPUN'[OPZ3'`V\'TH`IL'OH]L'MV\UK'[OL'ZVS\[PVU5
    Rllw'jvkpun'huk'{yhpupun'{opz'rpuk'vm'wyvisltz5'P['JV\SK'IL'YLHSS`'L_JP[PUN5
    Zv555
    TH`'[OL'JVKL'IL'^P[O'`V\5


    Example Output:

    This is a quite single problem.
    IF YOU ARE READING THIS, YOU MAYBE HAVE FOUND THE SOLUTION.
    Keep coding and training this kind of problems. IT COULD BE REALLY EXCITING.
    So...
    MAY THE CODE BE WITH YOU.


    It works just fine but when I submitted to UVa it always gives me runtime error.

    What does possibly I do wrong here?

    Thank you.

    Continue reading...

Compartilhe esta Página