結果
問題 |
No.1 道のショートカット
|
ユーザー |
|
提出日時 | 2018-03-11 13:26:46 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
MLE
|
実行時間 | - |
コード長 | 520 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 526,032 KB |
最終ジャッジ日時 | 2024-07-08 04:59:51 |
合計ジャッジ時間 | 7,049 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 7 MLE * 1 -- * 32 |
ソースコード
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 = sorted([(S[i], T[i], Y[i], M[i]) for i in range(0, V)]) L = [[] for i in range(1, N + 1)] L[0].append((0, 0)) for (s, t, y, m) in G: for (y2, m2) in L[s - 1]: if y2 + y <= C : L[t - 1].append((y + y2, m + m2)) if L[N - 1] == []: print(-1) else: print(min([t for (c, t) in L[N - 1]]))