結果

問題 No.1187 皇帝ペンギン
ユーザー mlihua09
提出日時 2020-08-22 14:43:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 428 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 27,976 KB
平均クエリ数 23.20
最終ジャッジ日時 2024-07-17 06:22:29
合計ジャッジ時間 9,999 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 RE * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

x = 0

y = 1000



while x < y:
    
    
    z = (x + y) // 2
    
    
    print('?', z)
    
    
    if input() == 'safe':
        
        sys.stdout.flush()
        
        x = z
        
        
        continue
    
    sys.stdout.flush()
    
    print('?', z + 1)
    if input() == 'safe':
        
        x = z + 1
    else:
        
        y = z - 1
        
    sys.stdout.flush()
    
print('!', x)
0