結果

問題 No.1187 皇帝ペンギン
ユーザー tails
提出日時 2020-08-22 17:08:00
言語 Perl
(5.40.0)
結果
WA  
実行時間 -
コード長 190 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 25,836 KB
平均クエリ数 27.00
最終ジャッジ日時 2024-07-17 06:33:54
合計ジャッジ時間 10,587 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 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;
		}else{
			$a=$c;
		}
	}else{
		$a=$c;
	}
}
print"! $a\n"
0