This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
import sys
n = int(input())
l = 1
r = n
while True:
mid = (l + r) // 2
print(f'? {mid}')
sys.stdout.flush()
res = int(input())
if res == -1:
l = mid + 1
elif res == 1:
r = mid - 1
else:
print(f'= {mid}')
sys.stdout.flush()
break
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |