結果

問題 No.929 よくあるボールを移動するやつ
ユーザー Theta
提出日時 2022-10-25 18:38:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 12,608 KB
最終ジャッジ日時 2024-07-03 16:24:28
合計ジャッジ時間 1,781 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    B = list(map(int, input().split()))

    stock = 0
    ctr = 0
    for b in B:
        stock += b - 1
        ctr += abs(stock)

    print(ctr)


if __name__ == "__main__":
    main()
0