結果

問題 No.2675 KUMA
ユーザー tailstails
提出日時 2024-03-18 16:18:51
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 477 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 6,932 KB
実行使用メモリ 26,752 KB
最終ジャッジ日時 2024-03-18 16:19:03
合計ジャッジ時間 4,483 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
13,480 KB
testcase_01 AC 12 ms
6,676 KB
testcase_02 AC 8 ms
6,676 KB
testcase_03 AC 8 ms
6,676 KB
testcase_04 AC 7 ms
6,676 KB
testcase_05 TLE -
testcase_06 AC 1,350 ms
26,752 KB
testcase_07 AC 7 ms
6,676 KB
testcase_08 TLE -
testcase_09 AC 567 ms
14,208 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$;=$";
@d=(-2,-2,-1,+1,+2,+2,+1,-1);
$n=<>;
for(0..$n-1){
	($x[$_],$y[$_])=($x,$y)=glob<>;
	$p{$x,$y}=1<<$_;
	for$j(0..7){
		$k{$x-$d[$j+6&7],$y-$d[$j]}=1;
	}
}
for(0..$n-1){
	delete $k{$x[$_],$y[$_]};
}
$b{0}=0;
for(keys%k){
	%a=%b;
	$k=$k{$_};
	($x,$y)=glob;
	for$j(0,2,4,6){
		$p=0;
		for(0,1){
			$p|=$p{$x+$d[$j+6&7^$_],$y+$d[$j^$_]};
		}
		if($p){
			for(keys%a){
				$b{$_|$p}=$a{$_}+1 if !defined $b{$_|$p} || $b{$_|$p}>$a{$_}+1;
			}
		}
	}
}
print $b{(1<<$n)-1}//-1;
0