結果

問題 No.609 Noelちゃんと星々
ユーザー 👑 H20H20
提出日時 2021-03-17 10:52:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 126 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 85,120 KB
最終ジャッジ日時 2024-04-26 21:25:31
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
79,232 KB
testcase_01 AC 60 ms
69,120 KB
testcase_02 AC 53 ms
65,664 KB
testcase_03 AC 57 ms
68,352 KB
testcase_04 AC 51 ms
63,232 KB
testcase_05 AC 82 ms
84,224 KB
testcase_06 AC 76 ms
79,872 KB
testcase_07 AC 63 ms
71,680 KB
testcase_08 AC 49 ms
61,952 KB
testcase_09 AC 59 ms
66,944 KB
testcase_10 AC 72 ms
74,624 KB
testcase_11 AC 67 ms
73,088 KB
testcase_12 AC 71 ms
77,056 KB
testcase_13 AC 49 ms
62,336 KB
testcase_14 AC 46 ms
60,544 KB
testcase_15 AC 79 ms
80,896 KB
testcase_16 AC 86 ms
84,096 KB
testcase_17 AC 78 ms
79,104 KB
testcase_18 AC 54 ms
65,792 KB
testcase_19 AC 76 ms
80,000 KB
testcase_20 AC 83 ms
84,480 KB
testcase_21 AC 84 ms
84,736 KB
testcase_22 AC 89 ms
85,120 KB
testcase_23 AC 84 ms
84,864 KB
testcase_24 AC 84 ms
85,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A = list(map(int,input().split()))
A.sort()
mid = A[N//2]
ans = 0 
for a in A:
    ans += abs(a-mid)
print(ans)
0