結果

問題 No.1 道のショートカット
ユーザー ああいいああいい
提出日時 2022-03-02 21:06:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 667 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 79,152 KB
最終ジャッジ日時 2023-09-23 12:06:42
合計ジャッジ時間 6,807 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,376 KB
testcase_01 AC 68 ms
71,160 KB
testcase_02 AC 68 ms
71,592 KB
testcase_03 AC 70 ms
71,596 KB
testcase_04 AC 69 ms
71,588 KB
testcase_05 AC 68 ms
71,400 KB
testcase_06 AC 68 ms
71,356 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 RE -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 RE -
testcase_43 RE -
権限があれば一括ダウンロードができます

ソースコード

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()))
G = [[] for _ in range(N+1)]
for i in range(N):
    G[S[i]].append((T[i],Y[i],M[i]))
inf = 1 << 30
dp = [[inf] * (C + 1) for _ in range(N+1)]
dp[1][0] = 0
for i in range(1,N+1):
    for c in range(C+1):
        for t,y,cc in G[i]:
            if c + y <= C:
                if dp[t][c+y] > dp[i][c] + cc:
                    dp[t][c+y] = dp[i][c] + cc
_min = inf
for c in range(C+1):
    if dp[-1][c] < _min:
        _min = dp[-1][c]
if _min == inf:
    _min = -1
print(_min)
0