On Sun, Apr 14, 2019 at 5:51 AM Saeon Piremakumar <[email protected]> wrote:
> Kept getting a TLE for this problem, is my code slow or is it just wrong > somewhere > . > ##### CODE ######### > import sys > t, n, m = map(int, input().split()) > > def solve(n,m): > > primes = [16,9,5,7,11,13,17] > possible = list(range(1,m+1)) > for night in range(n): > for dummy in range(18): > print (primes[night],end = " ") > sys.stdout.flush() > the 18th number is also followed by space, TLE because judge is waiting for newline > > a = list(input().split()) > a = [int(i) for i in a] > possible = [i for i in possible if i%primes[night] == sum(a)] > sum(a) % primes[night] > if len(possible) == 1: > print(possible[0]) > sys.stdout.flush() > need to read verdict (1 or -1) here > break > > for _ in range(t): > solve(n,m) > > ################### > Thanks > > -- 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/CAELs3C%3DUnjeL0-5MDFJcagG_VyT2iyKiPoqyfHTsJCrnGkggxA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
