I also was not able to successfully run my code. I've attached it below:


import sys

def main():
    cases = int(sys.stdin.readline())
    for case in range(cases):
        a,b = [int(n) for n in sys.stdin.readline().split()]
        response = ''
        while response != 'CORRECT':
            guess = (1+a+b)/2
            sys.stdout.write(str(guess)+'\n')
            sys.stdout.flush()
            response = sys.stdin.readline().strip()
            if response == 'TOO_SMALL':
                a = guess
            if response == 'TOO_BIG':
                b = guess - 1
            if response == 'WRONG_ANSWER':
                break
            
main()

-- 
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/a7405127-8ca7-475a-9075-580323e9f785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to