結果

問題 No.1 道のショートカット
ユーザー irisAshirisAsh
提出日時 2019-05-19 01:09:12
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 621 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,652 KB
最終ジャッジ日時 2023-09-22 13:29:34
合計ジャッジ時間 3,028 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,732 KB
testcase_01 AC 16 ms
7,844 KB
testcase_02 AC 16 ms
7,760 KB
testcase_03 AC 16 ms
7,944 KB
testcase_04 AC 15 ms
7,736 KB
testcase_05 AC 16 ms
7,812 KB
testcase_06 AC 15 ms
7,772 KB
testcase_07 AC 16 ms
7,788 KB
testcase_08 AC 62 ms
8,532 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 40 ms
8,200 KB
testcase_12 WA -
testcase_13 AC 84 ms
8,644 KB
testcase_14 WA -
testcase_15 AC 16 ms
8,392 KB
testcase_16 WA -
testcase_17 AC 16 ms
8,228 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 24 ms
8,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 83 ms
8,212 KB
testcase_25 AC 30 ms
8,260 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 16 ms
7,788 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 26 ms
8,232 KB
testcase_32 WA -
testcase_33 AC 41 ms
8,236 KB
testcase_34 AC 63 ms
8,264 KB
testcase_35 AC 18 ms
8,316 KB
testcase_36 WA -
testcase_37 AC 17 ms
8,212 KB
testcase_38 AC 18 ms
7,828 KB
testcase_39 WA -
testcase_40 AC 18 ms
8,300 KB
testcase_41 WA -
testcase_42 AC 15 ms
7,732 KB
testcase_43 AC 16 ms
8,232 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()))
d=[[None]*(c+1) for i in range(n)]
d[0][0] = 0
for i in range(v):
    for j in range(c+1):
        a=d[s[i]-1][j]
        if a is not None:
            q=y[i]+j
            if c < q:
                break
            p=t[i]-1
            x=a+m[i]
            if d[p][q] is None or x < d[p][q]:
                d[p][q] = x
o=None
for x in d[n-1]:
    if x is not None:
        if o is None or x < o:
            o=x
print(-1 if o is None else o)
0