On Thursday, April 11, 2019 at 12:21:58 AM UTC+5:30, F S wrote:
> On Monday, April 8, 2019 at 10:40:24 PM UTC+2, Abhishek Kalahal wrote:
> > RE means a runtime error happened, not an issue of time since the judge 
> > would've just said TLE (Time Limit Exceeded) if that was the case.
> > 
> > My program probably would've gotten a TLE for the hidden test set but it 
> > shouldn't be an issue for the first set, where the highest valued prime 
> > wouldn't exceed 10,000.
> > 
> > By the way Ralph, could you provide an example for the issue you stated? 
> > Were you referring to cases like ABA, where the first two numbers in the 
> > cipher text would be the same? I tried to account for that by including the 
> > statement "decipher = decipher [::-1]"
> 
> First, your program prints something before the Case. This will make it fail.
> 
> Second, your program doesn't work on:
> 
> 1
> 107 29
> 15 15 15 15 21 49 77 143 221 323 437 667 899 1147 1517 1763 2021 2491 3127 
> 3599 4087 4757 5183 5767 6557 7387 8633 9797 10403
> 
> It outputs "CACACBFDIEMFRGSHTJUKVLWNXOYPZQ", while the correct answer is 
> "ABABACCDEFGHIJKLMNOPQRSTUVWXYZ"


you can check my code that gives correct answer..still shows RE in codejam 
unacceptable..


def factors(n):
    ls=[]
    for i in range(2,n//2):
        if n%i==0:
            ls.append(i)
            break
    ls.append(n//i)

    return ls


t=int(input())
#start_time = time.time()

for ix in range(1,t+1):
    n,l=map(int,input().rstrip().split(" "))
    s=str(input().rstrip())
    ls=list(s.split(" "))
    j=0
    dict={}
    al=[]
    nm=[]

    for i in range(65,92):
        al.append(chr(i))
    fls=[]


    for i in ls:
        fls.append(factors(int(i)))


    l=factors(int(ls[0]))
    if int(ls[1])%l[0]==0:
        pv=l[0]
        ov=l[1]
    else:
        pv=l[1]
        ov=l[0]
    lll=[]
    lll.append(ov)
    lll.append(pv)
    for i in range(1,len(ls)):
        pv=int(ls[i])//pv
        lll.append(pv)

    llp=sorted(list(set(lll)))




    llt=[]
    for i in lll:
        llt.append(al[llp.index(i)])


    strg="".join(llt)
    print("Case #{}: {}".format(ix,strg))
    #print("--- %s seconds ---" % (time.time() - start_time))

-- 
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 google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/689270f1-7dbd-40c1-bda3-0f5f1771399d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to