結果
| 問題 |
No.1077 Noelちゃんと星々4
|
| コンテスト | |
| ユーザー |
paruf4
|
| 提出日時 | 2020-06-13 13:24:58 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 254 bytes |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 186,656 KB |
| 最終ジャッジ日時 | 2024-06-25 01:58:32 |
| 合計ジャッジ時間 | 3,635 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 1 -- * 19 |
ソースコード
n=int(input())
y=list(map(int,input().split()))
mx=max(y)
inf=10**18
dp=[[inf]*(mx+1) for i in range(n+1)]
dp[0][0]=0
for i in range(1,n+1):
mn=10**18
for j in range(mx+1):
mn=min(mn,dp[i-1][j])
dp[i][j]=mn+abs(y[i-1]-j)
print(min(dp[-1]))
paruf4