結果
問題 |
No.472 平均順位
|
ユーザー |
![]() |
提出日時 | 2020-02-20 10:05:24 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 813 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 82,164 KB |
実行使用メモリ | 905,044 KB |
最終ジャッジ日時 | 2024-10-08 18:44:26 |
合計ジャッジ時間 | 7,193 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 MLE * 1 |
other | AC * 9 MLE * 2 -- * 5 |
ソースコード
N, P = map(int, input().split()) INF = 10**10 dp = [[INF] * (P+1) for i in range(N+1)] dp[0][0] = 0 for i in range(N): dp[i+1][:] = dp[i][:] scores = list(map(int, input().split())) + [1] # 今まで解いた問題の合計 j for j in range(P+1): # if dp[i][j] == INF : continue # このコンテストで解いた問題数 k tmp = dp[i+1][j] score_j0 = dp[i][j] + scores[0] tmp = score_j0 if j - 1 >= 0: score_j1 = dp[i][j-1] + scores[1] tmp = min(tmp, score_j1) if j - 2 >= 0: score_j2 = dp[i][j-2] + scores[2] tmp = min(tmp, score_j2) if j - 3 >= 0: score_j3 = dp[i][j-3] + scores[3] tmp = min(tmp, score_j3) dp[i+1][j] = tmp print(dp[N][P]/N)