結果
| 問題 | No.1077 Noelちゃんと星々4 |
| コンテスト | |
| ユーザー |
paruf4
|
| 提出日時 | 2020-06-13 13:24:58 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 254 bytes |
| 記録 | |
| コンパイル時間 | 370 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 319,996 KB |
| 最終ジャッジ日時 | 2026-03-11 06:40:45 |
| 合計ジャッジ時間 | 39,623 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 TLE * 10 |
ソースコード
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