結果

問題 No.1187 皇帝ペンギン
コンテスト
ユーザー roaris
提出日時 2020-08-22 17:20:13
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 445 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 525 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 71,728 KB
平均クエリ数 21.33
最終ジャッジ日時 2026-03-31 21:17:33
合計ジャッジ時間 6,498 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#N, D = 40, 5

def return_inp(x):
    if x>=N or x%D==0:
        return 'out'
    else:
        return 'safe'
        
def judge(m):
    #res1 = return_inp(m)
    print('?', m)
    res1 = input()
    #res2 = return_inp(m+1)
    print('?', m+1)
    res2 = input()
    return res1=='out' and res2=='out'
    
l, r = 1, 10**3+100
    
while l<=r:
    m = (l+r)//2
        
    if judge(m):
        r = m-1
    else:
        l = m+1

print('!', l-1)
0