結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,088 KB
testcase_01 AC 6 ms
5,084 KB
testcase_02 AC 6 ms
5,340 KB
testcase_03 AC 3,491 ms
332,896 KB
testcase_04 AC 662 ms
9,024 KB
testcase_05 AC 6 ms
5,112 KB
testcase_06 AC 3,465 ms
330,552 KB
testcase_07 AC 1,486 ms
98,916 KB
testcase_08 AC 320 ms
24,112 KB
testcase_09 AC 420 ms
22,744 KB
testcase_10 AC 10 ms
5,300 KB
testcase_11 AC 7 ms
5,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
$T=<>;
@A=glob<>;
$d[0][$A[0]]='';
for$i(1..$N-1){
	for$v(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