結果

問題 No.572 妖精の演奏
ユーザー tailstails
提出日時 2017-10-07 01:33:53
言語 Perl
(5.38.2)
結果
AC  
実行時間 684 ms / 2,000 ms
コード長 391 bytes
コンパイル時間 660 ms
コンパイル使用メモリ 5,460 KB
実行使用メモリ 7,088 KB
最終ジャッジ日時 2023-08-10 18:29:44
合計ジャッジ時間 4,133 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
5,392 KB
testcase_01 AC 11 ms
5,116 KB
testcase_02 AC 6 ms
5,060 KB
testcase_03 AC 7 ms
5,208 KB
testcase_04 AC 11 ms
5,088 KB
testcase_05 AC 29 ms
5,380 KB
testcase_06 AC 48 ms
5,416 KB
testcase_07 AC 20 ms
5,240 KB
testcase_08 AC 25 ms
5,336 KB
testcase_09 AC 28 ms
5,316 KB
testcase_10 AC 198 ms
5,912 KB
testcase_11 AC 450 ms
6,444 KB
testcase_12 AC 518 ms
6,724 KB
testcase_13 AC 684 ms
7,088 KB
testcase_14 AC 102 ms
5,704 KB
testcase_15 AC 124 ms
5,540 KB
testcase_16 AC 84 ms
5,552 KB
testcase_17 AC 137 ms
5,588 KB
testcase_18 AC 19 ms
5,316 KB
testcase_19 AC 7 ms
5,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$n=<>-1;
@m=0..<>-1;
@1=map[glob],<>;

sub f{
	my($a)=@_;
	return if $a<2;
	return if $u{$a};
	my $b=int$a/2;
	my $c=$a-$b;
	f($b);
	f($c);
	for$y(@m){
		for$x(@m){
			for$z(@m){
				if($$a[$x][$y]<$$b[$x][$z]+$$c[$z][$y]){
					$$a[$x][$y]=$$b[$x][$z]+$$c[$z][$y];
				}
			}
		}
	}
	$u{$a}=1;
}
f($n);
$r=0;
for$y(@m){
	for$x(@m){
		if($r<$$n[$x][$y]){
			$r=$$n[$x][$y];
		}
	}
}
print$r;
0