# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
254760 | model_code | Guess the number (BOI20_guess) | Cpython 3 | 34 ms | 3412 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#!/usr/bin/env python3
a, b = 1, int(input())
while a < b:
m = (a + b) // 2
print("? {}".format(m), flush=True)
ans = int(input())
if ans < 0:
a = m + 1
elif ans > 0:
b = m - 1
else:
a = b = m
print("= {}".format(a))
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |