結果

問題 No.246 質問と回答
コンテスト
ユーザー Akihiro Sugawara
提出日時 2023-03-24 22:33:08
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ac-library)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 146 ms / 2,000 ms
+ 2µs
コード長 295 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 287 ms
コンパイル使用メモリ 21,412 KB
実行使用メモリ 15,780 KB
平均クエリ数 30.87
最終ジャッジ日時 2026-08-30 08:36:37
合計ジャッジ時間 5,741 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

ans_min = 0
ans_max = 10**9
while True:
    ans_half = (ans_min+ans_max)//2
    print("? ",ans_half)
    ans_ans = int(input())
    if ans_ans == 1:
        ans_min = ans_half
    else:
        ans_max = ans_half
    if ans_max - ans_min <= 1:
        print("! ",ans_min)
        exit()
        
0