結果

問題 No.1 道のショートカット
ユーザー tookunn_1213tookunn_1213
提出日時 2016-08-23 11:00:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 177 ms / 5,000 ms
コード長 545 bytes
コンパイル時間 1,387 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 76,896 KB
最終ジャッジ日時 2023-09-27 21:58:21
合計ジャッジ時間 6,344 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,276 KB
testcase_01 AC 74 ms
71,272 KB
testcase_02 AC 75 ms
71,272 KB
testcase_03 AC 79 ms
75,728 KB
testcase_04 AC 73 ms
71,472 KB
testcase_05 AC 74 ms
71,428 KB
testcase_06 AC 79 ms
75,608 KB
testcase_07 AC 79 ms
75,736 KB
testcase_08 AC 152 ms
76,640 KB
testcase_09 AC 117 ms
76,352 KB
testcase_10 AC 105 ms
76,200 KB
testcase_11 AC 115 ms
76,500 KB
testcase_12 AC 177 ms
76,576 KB
testcase_13 AC 174 ms
76,404 KB
testcase_14 AC 89 ms
76,352 KB
testcase_15 AC 78 ms
75,980 KB
testcase_16 AC 99 ms
76,456 KB
testcase_17 AC 85 ms
76,272 KB
testcase_18 AC 89 ms
76,316 KB
testcase_19 AC 91 ms
76,516 KB
testcase_20 AC 94 ms
76,284 KB
testcase_21 AC 97 ms
76,000 KB
testcase_22 AC 91 ms
76,316 KB
testcase_23 AC 111 ms
76,532 KB
testcase_24 AC 115 ms
76,896 KB
testcase_25 AC 97 ms
76,276 KB
testcase_26 AC 93 ms
75,996 KB
testcase_27 AC 124 ms
76,456 KB
testcase_28 AC 85 ms
76,160 KB
testcase_29 AC 97 ms
76,636 KB
testcase_30 AC 85 ms
76,264 KB
testcase_31 AC 94 ms
76,284 KB
testcase_32 AC 120 ms
76,116 KB
testcase_33 AC 109 ms
76,628 KB
testcase_34 AC 118 ms
76,716 KB
testcase_35 AC 82 ms
75,848 KB
testcase_36 AC 95 ms
76,488 KB
testcase_37 AC 83 ms
75,920 KB
testcase_38 AC 83 ms
76,336 KB
testcase_39 AC 98 ms
76,220 KB
testcase_40 AC 88 ms
76,324 KB
testcase_41 AC 84 ms
76,260 KB
testcase_42 AC 78 ms
75,772 KB
testcase_43 AC 78 ms
76,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,C,V = int(input()),int(input()),int(input())
S = [int(i) - 1 for i in input().split()]
T = [int(i) - 1 for i in input().split()]
Y = [int(i) for i in input().split()]
M = [int(i) for i in input().split()]
INF = 10 ** 9 + 7
dp = [[INF for j in range(C + 1)] for i in range(N)]
dp[0][0] = 0
for i in range(N):
	for j in range(C):
		for k in range(V):
			if S[k] == i and j + Y[k] <= C:
				dp[T[k]][j + Y[k]] = min(dp[T[k]][j + Y[k]],dp[i][j] + M[k])
ans = INF
for i in range(C + 1):
	ans = min(ans,dp[N - 1][i])
print(-1 if ans == INF else ans)
0