結果
| 問題 | 
                            No.1187 皇帝ペンギン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             takakin
                         | 
                    
| 提出日時 | 2020-08-22 23:28:24 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 384 bytes | 
| コンパイル時間 | 349 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 27,728 KB | 
| 平均クエリ数 | 17.02 | 
| 最終ジャッジ日時 | 2024-07-17 06:40:46 | 
| 合計ジャッジ時間 | 5,877 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 53 WA * 1 | 
ソースコード
import sys
input=lambda: sys.stdin.readline().rstrip()
print("?",1,flush=True)
res=input()
if res=="out":
	print(0)
	sys.exit()
else:
	l,r=1,1001
	while r-l>1:
		mid=(l+r)//2
		print("?",mid,flush=True)
		res=input()
		if res=="safe":
			l=mid
		else:
			print("?",mid+1,flush=True)
			res=input()
			if res=="safe":
				l=mid+1
			else:
				r=mid
	print("!",l,flush=True)
	sys.exit()
            
            
            
        
            
takakin