Could anyone post a working solution for the interactive problem using python? 
I just can't seem to get it to work, and when I use the testing script, the 
script just seems to stop and gives no output (and I can't seem to 
break/keyboard interrupt out of it)

My code is attached below:

import sys

def function(a,b,n):
    for _ in range(n):
        guess = (1+a+b)/2
        response = sys.stdin.readline().strip()
        if response == 'TOO_SMALL':
            a = guess
        elif response == 'TOO_BIG':
            b = guess - 1

cases = int(sys.stdin.readline())
for case in range(cases):
    a,b = [int(n) for n in sys.stdin.readline().split()]
    n = int(sys.stdin.readline())

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 
For more options, visit https://groups.google.com/d/optout.

Reply via email to