結果

問題 No.1 道のショートカット
ユーザー matsu7874matsu7874
提出日時 2015-12-07 21:36:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 271 ms / 5,000 ms
コード長 523 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,996 KB
最終ジャッジ日時 2023-09-27 21:50:00
合計ジャッジ時間 4,555 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,412 KB
testcase_01 AC 17 ms
8,484 KB
testcase_02 AC 16 ms
8,568 KB
testcase_03 AC 16 ms
8,524 KB
testcase_04 AC 16 ms
8,400 KB
testcase_05 AC 16 ms
8,512 KB
testcase_06 AC 16 ms
8,468 KB
testcase_07 AC 16 ms
8,392 KB
testcase_08 AC 217 ms
8,744 KB
testcase_09 AC 119 ms
8,636 KB
testcase_10 AC 69 ms
8,772 KB
testcase_11 AC 83 ms
8,768 KB
testcase_12 AC 271 ms
8,940 KB
testcase_13 AC 266 ms
8,996 KB
testcase_14 AC 30 ms
8,432 KB
testcase_15 AC 15 ms
8,576 KB
testcase_16 AC 49 ms
8,588 KB
testcase_17 AC 17 ms
8,424 KB
testcase_18 AC 24 ms
8,420 KB
testcase_19 AC 31 ms
8,572 KB
testcase_20 AC 37 ms
8,484 KB
testcase_21 AC 42 ms
8,496 KB
testcase_22 AC 28 ms
8,560 KB
testcase_23 AC 124 ms
8,652 KB
testcase_24 AC 143 ms
8,768 KB
testcase_25 AC 55 ms
8,512 KB
testcase_26 AC 43 ms
8,416 KB
testcase_27 AC 130 ms
8,740 KB
testcase_28 AC 18 ms
8,532 KB
testcase_29 AC 47 ms
8,864 KB
testcase_30 AC 22 ms
8,528 KB
testcase_31 AC 40 ms
8,564 KB
testcase_32 AC 156 ms
8,688 KB
testcase_33 AC 112 ms
8,728 KB
testcase_34 AC 185 ms
8,868 KB
testcase_35 AC 22 ms
8,568 KB
testcase_36 AC 47 ms
8,816 KB
testcase_37 AC 21 ms
8,732 KB
testcase_38 AC 21 ms
8,432 KB
testcase_39 AC 45 ms
8,556 KB
testcase_40 AC 22 ms
8,628 KB
testcase_41 AC 19 ms
8,492 KB
testcase_42 AC 16 ms
8,536 KB
testcase_43 AC 16 ms
8,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = int(input())
V = int(input())
S = list(map(int, input().split()))
T = list(map(int, input().split()))
Y = list(map(int, input().split()))
M = list(map(int, input().split()))

Vec = [(S[i], T[i], Y[i], M[i]) for i in range(V)]
Vec.sort()

dp = [[50001 for j in range(601)] for i in range(51)]
dp[1][C] = 0
for v in Vec:
    for i in range(C + 1):
        dp[v[1]][i] = min(dp[v[1]][i], dp[v[0]][i + v[2]] + v[3])
min_minute = min(dp[N])
if min_minute == 50001:
    print(-1)
else:
    print(min_minute)
0