結果

問題 No.929 よくあるボールを移動するやつ
ユーザー convexineqconvexineq
提出日時 2021-02-19 15:24:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 91,700 KB
最終ジャッジ日時 2023-10-14 09:38:20
合計ジャッジ時間 2,846 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
71,336 KB
testcase_01 AC 61 ms
71,412 KB
testcase_02 AC 59 ms
71,384 KB
testcase_03 AC 58 ms
71,272 KB
testcase_04 AC 58 ms
71,572 KB
testcase_05 AC 58 ms
71,388 KB
testcase_06 AC 61 ms
71,412 KB
testcase_07 AC 88 ms
81,036 KB
testcase_08 AC 93 ms
91,484 KB
testcase_09 AC 93 ms
91,672 KB
testcase_10 AC 92 ms
91,552 KB
testcase_11 AC 89 ms
91,596 KB
testcase_12 AC 85 ms
91,700 KB
testcase_13 AC 78 ms
91,452 KB
testcase_14 AC 80 ms
91,228 KB
testcase_15 AC 81 ms
91,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
ans = R = 0
acc = a[0]
for L in range(n):
    while R < n and acc < L+1:
        R += 1
        acc += a[R]
    ans += abs(R-L)
print(ans)
0