結果
| 問題 | No.1077 Noelちゃんと星々4 |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2020-06-12 22:26:08 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,830 ms / 2,000 ms |
| + 552µs | |
| コード長 | 264 bytes |
| 記録 | |
| コンパイル時間 | 409 ms |
| コンパイル使用メモリ | 14,592 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2026-11-04 19:59:12 |
| 合計ジャッジ時間 | 21,230 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
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))
tktk_snsn