結果
問題 |
No.1077 Noelちゃんと星々4
|
ユーザー |
![]() |
提出日時 | 2020-06-12 22:26:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 264 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 18,208 KB |
最終ジャッジ日時 | 2024-06-24 05:18:15 |
合計ジャッジ時間 | 3,966 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | TLE * 2 -- * 18 |
ソースコード
from itertools import accumulate N = int(input()) A = list(map(int, input().split())) U = 10 ** 4 + 10 inf = 10 ** 18 dp = [i for i in range(U)] for a in A: dp = list(accumulate(dp, func=min)) dp = [x + abs(i - a) for i, x in enumerate(dp)] print(min(dp))