結果

問題 No.1 道のショートカット
ユーザー %20%20
提出日時 2017-05-20 19:43:42
言語 Perl
(5.38.2)
結果
AC  
実行時間 3,487 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 5,352 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-09-27 22:07:48
合計ジャッジ時間 23,463 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,348 KB
testcase_01 AC 6 ms
5,132 KB
testcase_02 AC 6 ms
5,212 KB
testcase_03 AC 7 ms
5,316 KB
testcase_04 AC 6 ms
5,260 KB
testcase_05 AC 6 ms
5,176 KB
testcase_06 AC 6 ms
5,132 KB
testcase_07 AC 7 ms
5,204 KB
testcase_08 AC 1,002 ms
6,156 KB
testcase_09 AC 424 ms
5,676 KB
testcase_10 AC 440 ms
5,792 KB
testcase_11 AC 1,562 ms
5,860 KB
testcase_12 AC 2,719 ms
6,676 KB
testcase_13 AC 2,362 ms
6,612 KB
testcase_14 AC 28 ms
5,332 KB
testcase_15 AC 7 ms
5,152 KB
testcase_16 AC 142 ms
5,296 KB
testcase_17 AC 8 ms
5,132 KB
testcase_18 AC 61 ms
5,320 KB
testcase_19 AC 94 ms
5,428 KB
testcase_20 AC 327 ms
5,448 KB
testcase_21 AC 158 ms
5,272 KB
testcase_22 AC 67 ms
5,388 KB
testcase_23 AC 2,205 ms
6,044 KB
testcase_24 AC 2,200 ms
6,004 KB
testcase_25 AC 489 ms
5,436 KB
testcase_26 AC 189 ms
5,332 KB
testcase_27 AC 3,487 ms
6,060 KB
testcase_28 AC 10 ms
5,204 KB
testcase_29 AC 339 ms
5,992 KB
testcase_30 AC 30 ms
5,324 KB
testcase_31 AC 60 ms
5,712 KB
testcase_32 AC 846 ms
5,724 KB
testcase_33 AC 401 ms
5,808 KB
testcase_34 AC 1,132 ms
6,216 KB
testcase_35 AC 14 ms
5,744 KB
testcase_36 AC 186 ms
5,700 KB
testcase_37 AC 40 ms
5,664 KB
testcase_38 AC 19 ms
5,200 KB
testcase_39 AC 95 ms
5,372 KB
testcase_40 AC 45 ms
5,340 KB
testcase_41 AC 13 ms
5,168 KB
testcase_42 AC 6 ms
5,208 KB
testcase_43 AC 7 ms
5,132 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

($N,$C,$V,$S,$T,$Y,$M)=<>;
@$_=(0,glob$$_)for S,T,Y,M;
$d[1][0]=_;
for(1..$N-1){
	for$v(1..$V){
		for$c(0..$C-$Y[$v]){
			if($d[$S[$v]][$c]){
				$d[$T[$v]][$c+$Y[$v]]||=9e9;
				$d[$T[$v]][$c+$Y[$v]]-=$-=$d[$T[$v]][$c+$Y[$v]]-($d[$S[$v]][$c]+$M[$v]);
			}
		}
	}
}
@_=grep$_,@{$d[$N]};
print@_?(sort{$a-$b}@_)[0]:-1
0