結果

問題 No.247 線形計画問題もどき
ユーザー tailstails
提出日時 2015-07-17 23:23:24
言語 Perl
(5.38.2)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 184 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 9,332 KB
最終ジャッジ日時 2023-09-22 18:14:18
合計ジャッジ時間 5,251 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
7,536 KB
testcase_01 AC 2 ms
4,476 KB
testcase_02 TLE -
testcase_03 AC 2 ms
4,504 KB
testcase_04 AC 2 ms
4,588 KB
testcase_05 AC 2 ms
4,440 KB
testcase_06 AC 2 ms
4,572 KB
testcase_07 AC 24 ms
9,312 KB
testcase_08 AC 30 ms
9,244 KB
testcase_09 AC 2 ms
4,648 KB
testcase_10 AC 8 ms
9,228 KB
testcase_11 AC 3 ms
4,628 KB
testcase_12 AC 2 ms
4,520 KB
testcase_13 AC 2 ms
4,452 KB
testcase_14 AC 2 ms
4,564 KB
testcase_15 AC 2 ms
4,592 KB
testcase_16 AC 2 ms
4,616 KB
testcase_17 AC 50 ms
6,936 KB
testcase_18 AC 33 ms
4,932 KB
testcase_19 AC 160 ms
8,032 KB
testcase_20 AC 508 ms
8,544 KB
testcase_21 AC 5 ms
5,784 KB
testcase_22 AC 17 ms
6,120 KB
testcase_23 AC 6 ms
5,900 KB
testcase_24 AC 439 ms
9,332 KB
testcase_25 AC 289 ms
7,860 KB
testcase_26 AC 35 ms
7,524 KB
testcase_27 AC 34 ms
7,020 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Name "main::n" used only once: possible typo at Main.pl line 2.
Main.pl syntax OK

ソースコード

diff #

$c=<>;
$n=<>;
$/=$";@a=<>;
@d=(-1)x($c+1);

for$a(@a){
	$d[$a]=1;
	for$i($a+1..$c){
		if($d[$i-$a]>0 && ($d[$i]<0||$d[$i]>$d[$i-$a]+1) ){
			$d[$i]=$d[$i-$a]+1;
		}
	}
}
print $d[$c];
0