結果

問題 No.1 道のショートカット
ユーザー gigurururugigurururu
提出日時 2014-11-04 15:03:32
言語 Ruby
(3.3.0)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 202 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 19,792 KB
最終ジャッジ日時 2023-09-27 21:35:12
合計ジャッジ時間 5,611 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
15,132 KB
testcase_01 AC 71 ms
15,252 KB
testcase_02 AC 69 ms
15,044 KB
testcase_03 AC 67 ms
15,084 KB
testcase_04 AC 72 ms
15,144 KB
testcase_05 AC 67 ms
15,016 KB
testcase_06 AC 70 ms
15,168 KB
testcase_07 AC 69 ms
15,240 KB
testcase_08 AC 78 ms
16,008 KB
testcase_09 AC 74 ms
15,160 KB
testcase_10 AC 82 ms
15,652 KB
testcase_11 AC 94 ms
16,448 KB
testcase_12 AC 106 ms
19,284 KB
testcase_13 AC 101 ms
18,824 KB
testcase_14 AC 70 ms
15,152 KB
testcase_15 AC 68 ms
15,020 KB
testcase_16 AC 72 ms
15,288 KB
testcase_17 AC 67 ms
15,176 KB
testcase_18 AC 66 ms
15,228 KB
testcase_19 AC 70 ms
15,188 KB
testcase_20 AC 72 ms
15,376 KB
testcase_21 AC 70 ms
15,320 KB
testcase_22 AC 68 ms
15,124 KB
testcase_23 AC 116 ms
19,260 KB
testcase_24 AC 109 ms
18,840 KB
testcase_25 AC 78 ms
15,712 KB
testcase_26 AC 77 ms
15,464 KB
testcase_27 AC 106 ms
17,964 KB
testcase_28 AC 71 ms
15,024 KB
testcase_29 AC 80 ms
15,776 KB
testcase_30 AC 71 ms
15,124 KB
testcase_31 AC 78 ms
15,352 KB
testcase_32 AC 84 ms
16,372 KB
testcase_33 AC 77 ms
15,844 KB
testcase_34 AC 110 ms
19,792 KB
testcase_35 AC 83 ms
15,156 KB
testcase_36 AC 84 ms
15,420 KB
testcase_37 AC 73 ms
15,084 KB
testcase_38 AC 67 ms
15,240 KB
testcase_39 AC 71 ms
15,184 KB
testcase_40 AC 72 ms
15,244 KB
testcase_41 AC 72 ms
15,324 KB
testcase_42 AC 69 ms
15,272 KB
testcase_43 AC 67 ms
15,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,c=(1..3).map{gets.to_i}
l=(0..n).map{{}}
l[1][0]=0
(1..4).map{gets.split.map &:to_i}.transpose.sort.map{|s,t,y,m|
l[s].map{|k,v|k+y>c||l[t][k+y]=[l[t][k+y]||1e9,v+m].min}
}
p l[n].values.min||-1
0