Submission #986141

#TimeUsernameProblemLanguageResultExecution timeMemory
986141amirala21Guess the number (BOI20_guess)Cpython 3
29 / 100
13 ms3228 KiB
# -*- coding: utf-8 -*- """ Created on Sun May 19 23:49:29 2024 @author: amirk """ import sys def binary_search(l,n): mid=int((n+l)/2) if(True): print(f'? {mid}') sys.stdout.flush() q=int(input()) if q==-1: return binary_search(mid+1,N ) elif q==1: return binary_search(l, mid-1) elif q==0: return "= "+str(mid) else: return "Error" return "error" N=int(input()) L=1 print(binary_search(L, N))
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...