結果

問題 No.1187 皇帝ペンギン
ユーザー tails
提出日時 2020-08-22 17:10:12
言語 Perl
(5.40.0)
結果
AC  
実行時間 27 ms / 1,000 ms
コード長 192 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 25,464 KB
平均クエリ数 16.44
最終ジャッジ日時 2024-07-17 06:32:43
合計ジャッジ時間 4,306 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 54
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "out" may clash with future reserved word at Main.pl line 7.
Unquoted string "out" may clash with future reserved word at Main.pl line 10.
Main.pl syntax OK

ソースコード

diff #

$|=1;
$a=0;
$b=1001;
while($a<$b-1){
	$c=$a+$b>>1;
	print"? $c\n";
	if(<>=~out){
		++$c;
		print"? $c\n";
		if(<>=~out){
			$b=$c-1;
		}else{
			$a=$c;
		}
	}else{
		$a=$c;
	}
}
print"! $a\n"
0