Submission #257460

#TimeUsernameProblemLanguageResultExecution timeMemory
257460dolphingarlicGuess the number (BOI20_guess)Cpython 3
100 / 100
32 ms3564 KiB
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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...