結果

問題 No.594 壊れた宝物発見機
ユーザー tailstails
提出日時 2017-11-10 22:48:04
言語 Perl
(5.38.2)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 122 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 24,492 KB
平均クエリ数 31.00
最終ジャッジ日時 2023-09-23 14:48:06
合計ジャッジ時間 3,578 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
24,372 KB
testcase_01 AC 100 ms
24,384 KB
testcase_02 AC 102 ms
23,844 KB
testcase_03 AC 103 ms
23,616 KB
testcase_04 AC 102 ms
24,012 KB
testcase_05 AC 98 ms
23,652 KB
testcase_06 AC 99 ms
23,700 KB
testcase_07 AC 98 ms
23,712 KB
testcase_08 AC 100 ms
24,072 KB
testcase_09 AC 99 ms
23,868 KB
testcase_10 AC 101 ms
24,492 KB
testcase_11 AC 102 ms
23,424 KB
testcase_12 AC 97 ms
24,048 KB
testcase_13 AC 99 ms
24,012 KB
testcase_14 AC 100 ms
24,060 KB
testcase_15 AC 103 ms
24,048 KB
testcase_16 AC 102 ms
23,652 KB
testcase_17 AC 107 ms
23,520 KB
testcase_18 AC 108 ms
24,060 KB
testcase_19 AC 99 ms
23,388 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

sub f{
	$x0=-100;
	$x1=100;

	$x[$i]=$x0;
	print"? @x\n";
	$d0=<>;
	
	$x[$i]=$x1;
	print"? @x\n";
	$d1=<>;
	
	while($x0<$x1){
		if($d0>$d1){
			$x0=int(($x0+$x1+401)/2)-200;
			$x[$i]=$x0;
			print"? @x\n";
			$d0=<>;
		}else{
			$x1=int(($x0+$x1+400)/2)-200;
			$x[$i]=$x1;
			print"? @x\n";
			$d1=<>;
		}
	}
}

@x=(0,0,0);
$|=1;
for$i(0..2){
	f;
}
print"! @x\n";
0