On Tue, Apr 16, 2019 at 11:22 PM fellowjello <[email protected]> wrote:
> Hello, > > I have a question for the practice binary search guessing game. I am > having trouble with the stdout and stdin buffer (getting runtime/time out > error). My code is below: > > import sys > > def guessSession(A,B): > res = ""; > while(res != "CORRECT"): > if res == "TOO_BIG": > B = guess > elif res == "TOO_SMALL": > A = guess > guess = (A+B)//2 > print(guess) > sys.stdout.flush() > res = input() > > numTestCases = int(input()) > for i in range(numTestCases): > A, B = map(int, input().split()) > maxGuesses = input() > guessSession(A,B) > > After consulting the provided Google Python3 solution and the provided > judging test code (of which passes when run with my algorithm), I do not > know what may cause the error. > is guessSession(A,B) indented? > > I appreciate the help very much! > Fernando > -- 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/CAELs3Cm0WjSHT3xu_J5Vg0mOHqWFRm9sEbWWukK15NHD9E%3DPDA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
