Because it takes more time ,means execution time is more than give time.Please first find the time complexity of your code and then do some changes in you code . Thank you
On Thu, Mar 12, 2020, 1:38 AM Kartik Kumar Thakur <[email protected]> wrote: > this is my approach for cryptopangrams problem solved in Python3:- > > > def gcd(x, y): > > while y: > x, y = y, x % y > > return x > > > alpha = [] > count = 1 > t = int(input()) > while t > 0: > ans = "" > inp = input() > inp2 = input() > a, b = inp.split() > c = list(map(int, inp2.split())) > alpha.append(int(c[0] / gcd(c[0], c[1]))) > for i in range(len(c)): > alpha.append(int(c[i] / alpha[i])) > oalpha = alpha.copy() > alpha.sort() > l = len(alpha) - 1 > while l > 0: > if alpha[l] == alpha[l - 1]: > alpha.pop(l) > l = l - 1 > for i in oalpha: > ans = ans + chr(ord("A") + alpha.index(i)) > print("Case #" + str(count) + ": " + ans) > t = t - 1 > count = count + 1 > alpha.clear() > oalpha.clear() > > > Can someone please explain why i m getting runtime error on CodeJam. When > i run it locally using the sample input i dont get a RE. > As far as i have checked my code does not have a division by 0 in any > corner conditions. > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/86be5568-fcaa-4dc2-aa9e-4d33b9ca6410%40googlegroups.com > <https://groups.google.com/d/msgid/google-code/86be5568-fcaa-4dc2-aa9e-4d33b9ca6410%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CAH2Fd-BKMVL6JBmUMCEtjNdoPsi6AM9pDmW4CEHxe0ZnY9dyug%40mail.gmail.com.
