結果

問題 No.609 Noelちゃんと星々
ユーザー convexineqconvexineq
提出日時 2021-03-31 02:31:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 102 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 94,640 KB
最終ジャッジ日時 2023-08-20 22:17:23
合計ジャッジ時間 4,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
90,000 KB
testcase_01 AC 92 ms
81,760 KB
testcase_02 AC 87 ms
79,068 KB
testcase_03 AC 89 ms
80,912 KB
testcase_04 AC 80 ms
77,488 KB
testcase_05 AC 117 ms
94,264 KB
testcase_06 AC 107 ms
90,408 KB
testcase_07 AC 95 ms
83,544 KB
testcase_08 AC 79 ms
76,076 KB
testcase_09 AC 89 ms
79,948 KB
testcase_10 AC 100 ms
86,348 KB
testcase_11 AC 96 ms
85,160 KB
testcase_12 AC 103 ms
88,076 KB
testcase_13 AC 78 ms
76,092 KB
testcase_14 AC 77 ms
76,044 KB
testcase_15 AC 111 ms
91,564 KB
testcase_16 AC 116 ms
94,568 KB
testcase_17 AC 110 ms
89,980 KB
testcase_18 AC 87 ms
79,056 KB
testcase_19 AC 112 ms
90,428 KB
testcase_20 AC 121 ms
94,320 KB
testcase_21 AC 123 ms
94,576 KB
testcase_22 AC 122 ms
94,380 KB
testcase_23 AC 120 ms
94,476 KB
testcase_24 AC 120 ms
94,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
a.sort()
v = a[n//2]
print(sum(abs(ai-v) for ai in a))
0