結果

問題 No.1 道のショートカット
ユーザー matsu7874matsu7874
提出日時 2015-08-14 15:03:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 270 ms / 5,000 ms
コード長 522 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 9,000 KB
最終ジャッジ日時 2023-09-27 21:47:33
合計ジャッジ時間 4,277 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,568 KB
testcase_01 AC 14 ms
8,560 KB
testcase_02 AC 15 ms
8,420 KB
testcase_03 AC 14 ms
8,604 KB
testcase_04 AC 15 ms
8,420 KB
testcase_05 AC 16 ms
8,492 KB
testcase_06 AC 15 ms
8,568 KB
testcase_07 AC 15 ms
8,516 KB
testcase_08 AC 225 ms
8,700 KB
testcase_09 AC 115 ms
8,680 KB
testcase_10 AC 67 ms
8,712 KB
testcase_11 AC 81 ms
8,612 KB
testcase_12 AC 270 ms
8,924 KB
testcase_13 AC 262 ms
9,000 KB
testcase_14 AC 29 ms
8,548 KB
testcase_15 AC 14 ms
8,532 KB
testcase_16 AC 47 ms
8,520 KB
testcase_17 AC 15 ms
8,588 KB
testcase_18 AC 24 ms
8,584 KB
testcase_19 AC 32 ms
8,604 KB
testcase_20 AC 37 ms
8,640 KB
testcase_21 AC 40 ms
8,512 KB
testcase_22 AC 27 ms
8,432 KB
testcase_23 AC 127 ms
8,796 KB
testcase_24 AC 144 ms
8,752 KB
testcase_25 AC 54 ms
8,440 KB
testcase_26 AC 41 ms
8,452 KB
testcase_27 AC 113 ms
8,596 KB
testcase_28 AC 16 ms
8,552 KB
testcase_29 AC 41 ms
8,632 KB
testcase_30 AC 20 ms
8,476 KB
testcase_31 AC 38 ms
8,744 KB
testcase_32 AC 143 ms
8,656 KB
testcase_33 AC 103 ms
8,724 KB
testcase_34 AC 193 ms
8,892 KB
testcase_35 AC 19 ms
8,596 KB
testcase_36 AC 41 ms
8,608 KB
testcase_37 AC 19 ms
8,552 KB
testcase_38 AC 19 ms
8,448 KB
testcase_39 AC 42 ms
8,460 KB
testcase_40 AC 21 ms
8,648 KB
testcase_41 AC 17 ms
8,456 KB
testcase_42 AC 15 ms
8,428 KB
testcase_43 AC 14 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = int(input())
V = int(input())
S = [int(x) for x in input().split()]
T = [int(x) for x in input().split()]
Y = [int(x) for x in input().split()]
M = [int(x) for x in 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