結果
| 問題 | No.1 道のショートカット |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-11 13:26:46 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
TLE
(最新)
MLE
(最初)
|
| 実行時間 | - |
| コード長 | 520 bytes |
| 記録 | |
| コンパイル時間 | 413 ms |
| コンパイル使用メモリ | 20,572 KB |
| 実行使用メモリ | 16,348 KB |
| 最終ジャッジ日時 | 2026-03-29 22:10:08 |
| 合計ジャッジ時間 | 8,551 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 TLE * 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]]))