結果

問題 No.609 Noelちゃんと星々
ユーザー 👑 rin204rin204
提出日時 2022-01-19 21:17:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 113 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 92,400 KB
最終ジャッジ日時 2023-08-15 08:10:35
合計ジャッジ時間 5,383 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
88,172 KB
testcase_01 AC 91 ms
80,664 KB
testcase_02 AC 87 ms
78,764 KB
testcase_03 AC 88 ms
80,132 KB
testcase_04 AC 82 ms
76,932 KB
testcase_05 AC 113 ms
91,688 KB
testcase_06 AC 108 ms
88,712 KB
testcase_07 AC 96 ms
82,764 KB
testcase_08 AC 78 ms
76,300 KB
testcase_09 AC 87 ms
79,384 KB
testcase_10 AC 100 ms
85,132 KB
testcase_11 AC 97 ms
83,764 KB
testcase_12 AC 104 ms
86,464 KB
testcase_13 AC 81 ms
76,560 KB
testcase_14 AC 79 ms
76,324 KB
testcase_15 AC 111 ms
89,680 KB
testcase_16 AC 115 ms
91,844 KB
testcase_17 AC 107 ms
88,072 KB
testcase_18 AC 85 ms
78,796 KB
testcase_19 AC 106 ms
88,316 KB
testcase_20 AC 119 ms
92,228 KB
testcase_21 AC 117 ms
92,244 KB
testcase_22 AC 117 ms
92,136 KB
testcase_23 AC 121 ms
92,376 KB
testcase_24 AC 118 ms
92,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
Y = list(map(int, input().split()))
Y.sort()
mid = Y[n // 2]
print(sum(abs(y - mid) for y in Y))
0