Hey man!
Yeah, I tried pretty much the same thing too (same logic, different
implementation, python3) but got WA instead of RE.
Idk what the problem is, since it ran perfectly on my laptop too.

On Sun 7 Apr, 2019, 6:54 PM Abhishek Kalahal, <[email protected]>
wrote:

> Can anyone help me find out why am I getting RE status when I submit the
> following code?:
>
> def prime_factors(n):
>     i = 2
>     factors = []
>     while i * i <= n:
>         if n % i:
>             i += 1
>         else:
>             n //= i
>             factors.append(i)
>     if n > 1:
>         factors.append(n)
>     return factors
> alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> t = int(input())
> for i in range(1, t+1):
>     n, l = map(int, input().split())
>     cipher = list(map(int, input().split()))
>     decipher = prime_factors(cipher[0])
>     if cipher[1] % decipher[0] == 0:
>         decipher = decipher[::-1]
>     answer = []
>     j = 1
>     for word in cipher[1:]:
>         decipher.append(word // decipher[j])
>         j = j+1
>     print(decipher)
>     keys = sorted(list(set(decipher)))
>     for char in decipher:
>         answer.append(alpha[keys.index(char)])
>     print("Case #{}: {}".format(i, ''.join(answer)))
>
> It works fine when I run it on my PC for the sample inputs.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/aa337bf2-32a1-43f6-8d76-58718ee91e6b%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CALV%3DW74%2B%2BRDrmQ%2Bv1VSrW2S65s29-afnizugyMGrU78v-N3rHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to