結果

問題 No.527 ナップサック容量問題
ユーザー %20%20
提出日時 2018-05-31 21:06:52
言語 Perl
(5.38.2)
結果
AC  
実行時間 819 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 9,648 KB
最終ジャッジ日時 2023-09-12 21:06:37
合計ジャッジ時間 9,779 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,680 KB
testcase_01 AC 4 ms
4,612 KB
testcase_02 AC 3 ms
4,592 KB
testcase_03 AC 4 ms
4,604 KB
testcase_04 AC 2 ms
4,656 KB
testcase_05 AC 137 ms
6,724 KB
testcase_06 AC 615 ms
9,404 KB
testcase_07 AC 394 ms
8,144 KB
testcase_08 AC 97 ms
6,112 KB
testcase_09 AC 3 ms
4,536 KB
testcase_10 AC 590 ms
9,072 KB
testcase_11 AC 251 ms
7,248 KB
testcase_12 AC 151 ms
6,752 KB
testcase_13 AC 686 ms
9,376 KB
testcase_14 AC 105 ms
6,492 KB
testcase_15 AC 235 ms
7,372 KB
testcase_16 AC 4 ms
4,652 KB
testcase_17 AC 140 ms
6,568 KB
testcase_18 AC 187 ms
6,924 KB
testcase_19 AC 5 ms
4,788 KB
testcase_20 AC 87 ms
6,296 KB
testcase_21 AC 773 ms
9,448 KB
testcase_22 AC 408 ms
8,436 KB
testcase_23 AC 619 ms
8,844 KB
testcase_24 AC 37 ms
5,768 KB
testcase_25 AC 307 ms
7,800 KB
testcase_26 AC 266 ms
7,468 KB
testcase_27 AC 304 ms
7,848 KB
testcase_28 AC 235 ms
7,536 KB
testcase_29 AC 819 ms
9,648 KB
testcase_30 AC 3 ms
4,592 KB
testcase_31 AC 4 ms
4,528 KB
testcase_32 AC 4 ms
4,552 KB
testcase_33 AC 4 ms
4,692 KB
testcase_34 AC 4 ms
4,704 KB
testcase_35 AC 252 ms
7,556 KB
testcase_36 AC 4 ms
4,856 KB
testcase_37 AC 148 ms
6,884 KB
testcase_38 AC 187 ms
7,176 KB
testcase_39 AC 181 ms
6,952 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "inf" may clash with future reserved word at Main.pl line 19.
Main.pl syntax OK

ソースコード

diff #

<>;
@vw=<>;
$V=pop@vw;
for(@vw){
	($v,$w)=split;
	for(reverse 0..@d){
		$w?$d[$_+$w]+=$-=$d[$_]+$v-$d[$_+$w]:0
	}
}
for(@d){
	if($_==$V){
		$a||=$i
	}
	if($_>$V){
		$b||=$i-1
	}
	++$i
}
print$a,$/,$b||inf
0