結果

問題 No.506 限られたジャパリまん
ユーザー tailstails
提出日時 2020-11-05 12:32:41
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 387 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 5,392 KB
実行使用メモリ 5,456 KB
最終ジャッジ日時 2023-09-10 12:56:55
合計ジャッジ時間 4,096 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,212 KB
testcase_01 AC 7 ms
5,208 KB
testcase_02 AC 10 ms
5,220 KB
testcase_03 AC 6 ms
5,372 KB
testcase_04 AC 76 ms
5,236 KB
testcase_05 AC 18 ms
5,164 KB
testcase_06 AC 7 ms
5,084 KB
testcase_07 AC 37 ms
5,456 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
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 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($h,$w,$k,$p)=glob<>;
@f=map[glob],<>;
$a[0][1]=1;
for$i(0..(1<<$k)-1){
	if(unpack("%b*",pack(V,$i))==$p){
		for$y(0..$w){
			for$x(0..$h){
				$a[$y+1][$x+1]=
				grep(!($i&1<<$_|$f[$_][0]-$x|$f[$_][1]-$y),0..$k-1)?0:
				$a[$y][$x+1]+$a[$y+1][$x];
			}
		}
		if($bv<$a[$w+1][$h+1]){
			$bv=$a[$w+1][$h+1];
			$bi=$i;
		}
	}
}
$,=$/;
print$bv%=1e9+7,map$f[$_][2],grep$bi&1<<$_,0..$k-1;
0