結果

問題 No.929 よくあるボールを移動するやつ
ユーザー _matumo__matumo_
提出日時 2020-01-03 21:41:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 159 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 10,760 KB
実行使用メモリ 10,092 KB
最終ジャッジ日時 2023-08-14 19:30:59
合計ジャッジ時間 1,699 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,848 KB
testcase_01 AC 15 ms
7,768 KB
testcase_02 AC 15 ms
7,848 KB
testcase_03 AC 15 ms
7,804 KB
testcase_04 AC 15 ms
7,972 KB
testcase_05 AC 15 ms
7,864 KB
testcase_06 AC 15 ms
7,796 KB
testcase_07 AC 26 ms
8,864 KB
testcase_08 AC 43 ms
9,960 KB
testcase_09 AC 44 ms
10,028 KB
testcase_10 AC 44 ms
9,880 KB
testcase_11 AC 47 ms
10,092 KB
testcase_12 AC 44 ms
10,088 KB
testcase_13 AC 46 ms
9,888 KB
testcase_14 AC 46 ms
10,016 KB
testcase_15 AC 45 ms
9,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N=int(input())
    p=[int(s)-1 for s in input().split()]
    d=m=0
    for i in range(N):
        d+=p[i]
        m+=abs(d)
    print(m)
main()
0