結果

問題 No.929 よくあるボールを移動するやつ
ユーザー takakintakakin
提出日時 2020-05-27 00:09:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 14,356 KB
最終ジャッジ日時 2023-08-03 05:27:33
合計ジャッジ時間 1,685 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,828 KB
testcase_01 AC 15 ms
7,784 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 15 ms
7,776 KB
testcase_04 AC 15 ms
7,860 KB
testcase_05 AC 15 ms
7,804 KB
testcase_06 AC 15 ms
7,920 KB
testcase_07 AC 42 ms
9,596 KB
testcase_08 AC 80 ms
12,272 KB
testcase_09 AC 80 ms
12,140 KB
testcase_10 AC 79 ms
13,756 KB
testcase_11 AC 78 ms
13,480 KB
testcase_12 AC 77 ms
13,268 KB
testcase_13 AC 78 ms
14,356 KB
testcase_14 AC 79 ms
14,248 KB
testcase_15 AC 79 ms
14,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
B=[int(i) for i in input().split()]
C=[]
for i,b in enumerate(B):
  C+=[i]*b
print(sum([abs(i-C[i]) for i in range(n)]))
0