結果

問題 No.1187 皇帝ペンギン
ユーザー H3PO4
提出日時 2021-11-12 09:01:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 49 ms / 1,000 ms
コード長 253 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,352 KB
平均クエリ数 16.48
最終ジャッジ日時 2024-11-24 15:09:42
合計ジャッジ時間 5,427 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

def question(x):
    print(f"? {x}", flush=True)
    return input() == 'safe'


l, r = 0, 1000
while (r - l) > 1:
    m = (r + l) // 2
    if question(m):
        l = m
    elif question(m + 1):
        l = m + 1
    else:
        r = m
print(f"! {l}")
0