結果

問題 No.168 ものさし
ユーザー tailstails
提出日時 2015-03-20 00:15:16
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 5,292 KB
実行使用メモリ 102,196 KB
最終ジャッジ日時 2023-09-11 08:54:24
合計ジャッジ時間 8,474 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 3 ms
4,684 KB
testcase_03 WA -
testcase_04 AC 3 ms
4,644 KB
testcase_05 AC 3 ms
4,540 KB
testcase_06 AC 3 ms
4,596 KB
testcase_07 AC 2 ms
4,484 KB
testcase_08 AC 2 ms
4,772 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>;
<>=~/ /,$x[$_]=$`+0,$y[$_]=$'+0 for 1..$n;

for$i(1..$n){
	for$j(1..$i-1){
		$d{"$j,$i"}=($x[$i]-$x[$j])**2+($y[$i]-$y[$j])**2;
	}
}

@i=0..$n;

for(sort{$d{$a}<=>$d{$b}}keys%d){
	 /,/;$j=$`+0;$i=$'+0;
	 for(@i){
		$_=$i[$j] if$_==$i[$i];
	 }
	 if($i[$n]==$i[1]){
		print +(sqrt($d{$_})/10+.9999999999|0)*10 ;exit;
	 }
}

0