結果

問題 No.1 道のショートカット
ユーザー %20%20
提出日時 2017-05-20 19:43:42
言語 Perl
(5.38.2)
結果
AC  
実行時間 3,069 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 5,888 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-07-20 16:31:07
合計ジャッジ時間 19,690 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
6,016 KB
testcase_01 AC 6 ms
6,016 KB
testcase_02 AC 6 ms
6,016 KB
testcase_03 AC 7 ms
6,016 KB
testcase_04 AC 6 ms
6,016 KB
testcase_05 AC 6 ms
5,888 KB
testcase_06 AC 6 ms
6,016 KB
testcase_07 AC 7 ms
6,016 KB
testcase_08 AC 874 ms
6,912 KB
testcase_09 AC 369 ms
6,400 KB
testcase_10 AC 378 ms
6,656 KB
testcase_11 AC 1,391 ms
6,784 KB
testcase_12 AC 2,419 ms
7,168 KB
testcase_13 AC 2,036 ms
7,168 KB
testcase_14 AC 25 ms
6,016 KB
testcase_15 AC 8 ms
5,888 KB
testcase_16 AC 121 ms
6,144 KB
testcase_17 AC 7 ms
6,016 KB
testcase_18 AC 52 ms
6,272 KB
testcase_19 AC 79 ms
6,016 KB
testcase_20 AC 285 ms
6,272 KB
testcase_21 AC 133 ms
6,016 KB
testcase_22 AC 57 ms
6,144 KB
testcase_23 AC 1,950 ms
6,944 KB
testcase_24 AC 1,943 ms
6,912 KB
testcase_25 AC 423 ms
6,400 KB
testcase_26 AC 165 ms
6,400 KB
testcase_27 AC 3,069 ms
6,912 KB
testcase_28 AC 11 ms
6,144 KB
testcase_29 AC 301 ms
6,784 KB
testcase_30 AC 26 ms
6,144 KB
testcase_31 AC 52 ms
6,272 KB
testcase_32 AC 725 ms
6,656 KB
testcase_33 AC 340 ms
6,528 KB
testcase_34 AC 988 ms
6,912 KB
testcase_35 AC 14 ms
6,528 KB
testcase_36 AC 170 ms
6,656 KB
testcase_37 AC 36 ms
6,400 KB
testcase_38 AC 16 ms
5,888 KB
testcase_39 AC 79 ms
6,272 KB
testcase_40 AC 39 ms
6,272 KB
testcase_41 AC 12 ms
6,272 KB
testcase_42 AC 7 ms
5,888 KB
testcase_43 AC 6 ms
6,016 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