結果

問題 No.707 書道
ユーザー %20%20
提出日時 2018-06-30 00:45:03
言語 Perl
(5.38.2)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 5,420 KB
実行使用メモリ 5,348 KB
最終ジャッジ日時 2023-09-13 15:58:21
合計ジャッジ時間 1,378 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
5,012 KB
testcase_01 AC 6 ms
5,132 KB
testcase_02 AC 23 ms
5,256 KB
testcase_03 AC 6 ms
5,196 KB
testcase_04 AC 6 ms
5,196 KB
testcase_05 AC 49 ms
5,244 KB
testcase_06 AC 70 ms
5,184 KB
testcase_07 AC 91 ms
5,348 KB
testcase_08 AC 8 ms
5,144 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 3.
Main.pl syntax OK

ソースコード

diff #

($H,$W)=glob<>;
@_=map[/./g],<>;
$D=inf;
for((map{[$_,-1],[$_,$W]}0..$H-1),map{[-1,$_],[$H,$_]}0..$W-1){
	($Y,$X)=@$_;
	$d=0;
	for$y(0..$H-1){
		for$x(0..$W-1){
			if($_[$y][$x]){
				$d+=sqrt(($Y-$y)**2+($X-$x)**2)
			}
		}
	}
	$D=$d if$d<$D
}
print$D
0