結果

問題 No.246 質問と回答
コンテスト
ユーザー nebukuro09
提出日時 2016-09-03 17:39:01
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 332 bytes
記録
コンパイル時間 139 ms
コンパイル使用メモリ 77,452 KB
最終ジャッジ日時 2025-12-03 21:23:18
ジャッジサーバーID
(参考情報)
judge2 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys

high = 10**9
low = 1
while high-low > 1:
    middle = (high+low)/2
    print "? %d" % middle
    sys.stdout.flush()
    if int(raw_input()) == 1:
        low = middle
    else:
        high = middle

print "? %d" % low
sys.stdout.flush()
print "! %d" % low if int(raw_input()) == 1 else "! %d" % high
sys.stdout.flush()
0