結果
| 問題 | 
                            No.1187 皇帝ペンギン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             titia
                         | 
                    
| 提出日時 | 2020-08-22 13:14:16 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 56 ms / 1,000 ms | 
| コード長 | 450 bytes | 
| コンパイル時間 | 136 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 27,464 KB | 
| 平均クエリ数 | 16.44 | 
| 最終ジャッジ日時 | 2024-07-17 06:08:15 | 
| 合計ジャッジ時間 | 5,811 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 54 | 
ソースコード
import sys
input = sys.stdin.readline
NG=10**3
OK=0
while NG-OK>4:
    mid=(OK+NG)//2
    print("?",mid,flush=True)
    if input().strip()=="safe":
        OK=mid
    else:
        print("?",mid-1,flush=True)
        if input().strip()=="safe":
            OK=mid-1
        else:
            NG=mid-1
for i in range(NG,OK,-1):
    print("?",i,flush=True)
    if input().strip()=="safe":
        OK=i
        break
    
print("!",OK,flush=True)
            
            
            
        
            
titia