結果
| 問題 |
No.1037 exhausted
|
| ユーザー |
nehan_der_thal
|
| 提出日時 | 2020-04-24 23:55:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 460 bytes |
| コンパイル時間 | 1,556 ms |
| コンパイル使用メモリ | 81,496 KB |
| 実行使用メモリ | 77,104 KB |
| 最終ジャッジ日時 | 2024-10-15 03:58:17 |
| 合計ジャッジ時間 | 3,049 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 RE * 2 |
ソースコード
N, V, L = map(int, input().split())
inf = 10**18
dp = [inf]*(V+1)
dp[V] = 0
bx = 0
for _ in range(N):
ndp = [inf] * (V+1)
x, v, w = map(int, input().split())
for vl in range(V+1):
if vl+(x-bx) > V:
continue
ndp[vl] = dp[vl+(x-bx)]
for vl in range(V, -1, -1):
vi = min(vl+v, V)
ndp[vi] = min(ndp[vi], ndp[vl]+w)
dp = ndp
bx = x
R = min(dp[L-bx:])
if R >= inf:
print(-1)
else:
print(R)
nehan_der_thal