結果
問題 |
No.1077 Noelちゃんと星々4
|
ユーザー |
👑 ![]() |
提出日時 | 2020-06-12 22:38:47 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 228 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 63,332 KB |
最終ジャッジ日時 | 2024-06-24 05:23:49 |
合計ジャッジ時間 | 2,348 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 1 WA * 19 |
ソースコード
from copy import copy N=int(input()) Y=[0]+list(map(int,input().split()))+[10**10] Z=copy(Y) for i in range(N+1): if Z[i]>Z[i+1]: while Z[i]>Z[i+1]: Z[i+1]+=1 if Z[i-1]<Z[i]: Z[i]-=1 C=0 for i in range(1,N+1): C+=abs(Y[i]-Z[i]) print(C)