結果

問題 No.693 square1001 and Permutation 2
ユーザー iiiiii
提出日時 2022-09-13 17:55:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 122 bytes
コンパイル時間 1,110 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 71,476 KB
最終ジャッジ日時 2023-08-20 19:33:19
合計ジャッジ時間 2,075 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,476 KB
testcase_01 AC 73 ms
71,400 KB
testcase_02 AC 74 ms
71,228 KB
testcase_03 AC 70 ms
71,220 KB
testcase_04 AC 72 ms
71,352 KB
testcase_05 AC 71 ms
71,160 KB
testcase_06 AC 71 ms
71,052 KB
testcase_07 AC 72 ms
71,240 KB
testcase_08 AC 74 ms
71,236 KB
testcase_09 AC 74 ms
71,452 KB
testcase_10 AC 74 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a = int(input())
b = sorted(map(int,input().split()))
ans = 0

for i in range(a):
    ans += abs(b[i] - (i+1))

print(ans)
0