結果

問題 No.1 道のショートカット
ユーザー %20%20
提出日時 2017-05-20 19:51:02
言語 Perl
(5.38.2)
結果
AC  
実行時間 2,420 ms / 5,000 ms
コード長 308 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 5,372 KB
実行使用メモリ 6,544 KB
最終ジャッジ日時 2023-09-27 22:08:53
合計ジャッジ時間 18,064 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,340 KB
testcase_01 AC 7 ms
5,188 KB
testcase_02 AC 7 ms
5,268 KB
testcase_03 AC 6 ms
5,260 KB
testcase_04 AC 6 ms
5,320 KB
testcase_05 AC 6 ms
5,208 KB
testcase_06 AC 6 ms
5,208 KB
testcase_07 AC 7 ms
5,372 KB
testcase_08 AC 919 ms
6,004 KB
testcase_09 AC 414 ms
5,748 KB
testcase_10 AC 359 ms
5,820 KB
testcase_11 AC 1,124 ms
5,868 KB
testcase_12 AC 2,071 ms
6,536 KB
testcase_13 AC 1,829 ms
6,544 KB
testcase_14 AC 29 ms
5,276 KB
testcase_15 AC 7 ms
5,252 KB
testcase_16 AC 138 ms
5,396 KB
testcase_17 AC 8 ms
5,352 KB
testcase_18 AC 61 ms
5,276 KB
testcase_19 AC 93 ms
5,284 KB
testcase_20 AC 255 ms
5,412 KB
testcase_21 AC 149 ms
5,376 KB
testcase_22 AC 64 ms
5,300 KB
testcase_23 AC 1,524 ms
5,980 KB
testcase_24 AC 1,534 ms
5,944 KB
testcase_25 AC 369 ms
5,652 KB
testcase_26 AC 155 ms
5,420 KB
testcase_27 AC 2,420 ms
6,188 KB
testcase_28 AC 10 ms
5,268 KB
testcase_29 AC 242 ms
6,084 KB
testcase_30 AC 23 ms
5,372 KB
testcase_31 AC 45 ms
5,720 KB
testcase_32 AC 705 ms
5,892 KB
testcase_33 AC 355 ms
5,696 KB
testcase_34 AC 804 ms
5,944 KB
testcase_35 AC 14 ms
5,752 KB
testcase_36 AC 153 ms
5,632 KB
testcase_37 AC 33 ms
5,712 KB
testcase_38 AC 18 ms
5,284 KB
testcase_39 AC 94 ms
5,404 KB
testcase_40 AC 41 ms
5,480 KB
testcase_41 AC 13 ms
5,276 KB
testcase_42 AC 6 ms
5,292 KB
testcase_43 AC 6 ms
5,148 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]];
				$t=$d[$S[$v]][$c]+$M[$v];
				if(!$$_||$t<$$_){
					$$_=$t
				}
			}
		}
	}
}
@_=grep$_,@{$d[$N]};
print@_?(sort{$a-$b}@_)[0]:-1
0