結果

問題 No.1187 皇帝ペンギン
ユーザー takakin
提出日時 2020-08-22 23:18:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 27,600 KB
平均クエリ数 16.56
最終ジャッジ日時 2024-07-17 06:41:10
合計ジャッジ時間 16,265 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 52
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
			if res=="safe":
				l=mid+1
			else:
				r=mid
	print("!",l,flush=True)
	sys.exit()
0