結果

問題 No.10 +か×か
ユーザー %20%20
提出日時 2017-07-09 18:23:02
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 46 ms
コンパイル使用メモリ 6,016 KB
実行使用メモリ 297,472 KB
最終ジャッジ日時 2024-04-16 11:10:22
合計ジャッジ時間 9,760 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,016 KB
testcase_01 AC 8 ms
6,144 KB
testcase_02 AC 8 ms
6,016 KB
testcase_03 AC 3,137 ms
297,472 KB
testcase_04 WA -
testcase_05 AC 7 ms
6,144 KB
testcase_06 AC 3,127 ms
295,168 KB
testcase_07 WA -
testcase_08 AC 316 ms
25,344 KB
testcase_09 AC 439 ms
26,112 KB
testcase_10 AC 12 ms
6,144 KB
testcase_11 AC 8 ms
6,016 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