結果

問題 No.929 よくあるボールを移動するやつ
ユーザー kohei2019kohei2019
提出日時 2022-05-14 14:49:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 165 bytes
コンパイル時間 962 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 89,920 KB
最終ジャッジ日時 2023-09-30 06:20:55
合計ジャッジ時間 3,100 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,260 KB
testcase_01 AC 66 ms
71,468 KB
testcase_02 AC 65 ms
71,148 KB
testcase_03 AC 65 ms
70,992 KB
testcase_04 AC 66 ms
71,064 KB
testcase_05 AC 62 ms
71,096 KB
testcase_06 AC 63 ms
71,256 KB
testcase_07 AC 76 ms
80,000 KB
testcase_08 AC 86 ms
89,616 KB
testcase_09 AC 88 ms
89,664 KB
testcase_10 AC 86 ms
89,648 KB
testcase_11 AC 88 ms
89,560 KB
testcase_12 AC 85 ms
89,920 KB
testcase_13 AC 83 ms
89,520 KB
testcase_14 AC 84 ms
89,528 KB
testcase_15 AC 85 ms
89,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsB = list(map(int,input().split()))
lsB0 = [b-1 for b in lsB]
ans = 0
cnt = 0
for i in range(N):
    cnt += lsB0[i]
    ans += abs(cnt)
print(ans)
0