Because you program take more time as given,please first find time complexity of your program. Thank you
On Wed, Mar 18, 2020, 7:34 PM RCODE <[email protected]> wrote: > t = int(input()) > global first > for i in range(1, t + 1): > n, group = input(), input() > > > def gcd(a, b): > if a == 0: > return b > > return gcd(b % a, a) > > for l in range(len(group.split())-1): > if group.split()[l] != group.split()[l+1]: > first = gcd(int(group.split()[l]), int(group.split()[l+1])) > break > plist = [] > count = 1 > plist.append(int(int(group.split()[0]) / first)) > plist.append(int(first)) > for r in group.split()[1:]: > plist.append(int(int(r) / plist[count])) > count += 1 > > vlist = sorted(list(set(plist))) > solve = {} > for j in range(len(vlist)): > solve[vlist[j]] = chr(j + 65) > final = '' > for x in plist: > final += solve[x] > print("Case #" + str(i) + ": " + final) > > I get a RE error even though sample sets execute perfectly. Pls help > > -- > 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/aed320cc-ce38-47f5-99b4-d3c1b5fcc484%40googlegroups.com > <https://groups.google.com/d/msgid/google-code/aed320cc-ce38-47f5-99b4-d3c1b5fcc484%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-CCgb6Pnw2du9Oz4yJAJddk14dzY%2Bkj8V_e94oU72EgQA%40mail.gmail.com.
