結果
| 問題 | No.707 書道 | 
| コンテスト | |
| ユーザー |  %20 | 
| 提出日時 | 2018-06-30 00:45:03 | 
| 言語 | Perl (5.40.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 95 ms / 2,000 ms | 
| コード長 | 253 bytes | 
| コンパイル時間 | 537 ms | 
| コンパイル使用メモリ | 6,940 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-01 00:38:10 | 
| 合計ジャッジ時間 | 912 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 3. Main.pl syntax OK
ソースコード
($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
            
            
            
        