結果

問題 No.246 質問と回答
ユーザー zombietan
提出日時 2016-06-02 09:12:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,736 KB
平均クエリ数 30.87
最終ジャッジ日時 2024-07-16 20:04:08
合計ジャッジ時間 5,129 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math

low = 1
high = 10**9 + 1
ans = 1

while low <= high:
    center = math.floor((low + high)/2)
    print('?', center)
    sys.stdout.flush()
    r = input()
    if r == '1':
        ans = center
        low = center + 1
    else:
        high = center - 1

print('!', ans)
sys.stdout.flush()
0