結果
| 問題 |
No.472 平均順位
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-10-20 12:20:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 82,912 KB |
| 実行使用メモリ | 112,164 KB |
| 最終ジャッジ日時 | 2024-09-20 07:50:26 |
| 合計ジャッジ時間 | 6,590 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 10 TLE * 1 -- * 5 |
ソースコード
import sys
input = sys.stdin.readline
N, P = map(int, input().split())
inf = 10 ** 18
pre = [inf] * (P + 1)
pre[0] = 0
for _ in range(N):
dp = [inf] * (P + 1)
a, b, c = map(int, input().split())
L = [a, b, c, 1]
for i in range(P + 1):
for j in range(4):
if i - j < 0:
continue
dp[i] = min(dp[i], pre[i - j] + L[j])
pre, dp = dp, pre
print(pre[-1]/N)
rlangevin