結果

問題 No.10 +か×か
ユーザー %20%20
提出日時 2017-07-09 18:25:35
言語 Perl
(5.38.2)
結果
AC  
実行時間 3,537 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 5,448 KB
実行使用メモリ 335,632 KB
最終ジャッジ日時 2023-08-21 06:23:23
合計ジャッジ時間 11,040 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,300 KB
testcase_01 AC 6 ms
5,216 KB
testcase_02 AC 6 ms
5,156 KB
testcase_03 AC 3,537 ms
335,632 KB
testcase_04 AC 734 ms
11,428 KB
testcase_05 AC 6 ms
5,036 KB
testcase_06 AC 3,519 ms
332,712 KB
testcase_07 AC 1,450 ms
100,912 KB
testcase_08 AC 339 ms
25,324 KB
testcase_09 AC 462 ms
25,796 KB
testcase_10 AC 10 ms
5,336 KB
testcase_11 AC 7 ms
5,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
$T=<>;
@A=glob<>;
$d[0][$A[0]]='';
for$i(1..$N-1){
	for$v(reverse 1..$T){
		$d[$i][$v*$A[$i]]="$d[$i-1][$v]*"if defined$d[$i-1][$v] && $v*$A[$i]<=$T && "$d[$i-1][$v]*"gt$d[$i][$v*$A[$i]];
		$d[$i][$v+$A[$i]]="$d[$i-1][$v]+"if defined$d[$i-1][$v] && $v+$A[$i]<=$T && "$d[$i-1][$v]+"gt$d[$i][$v+$A[$i]];
	}
}
print$d[$N-1][$T]
0