結果

問題 No.609 Noelちゃんと星々
ユーザー rin204rin204
提出日時 2022-01-19 21:17:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 113 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 88,320 KB
最終ジャッジ日時 2024-05-02 19:58:49
合計ジャッジ時間 4,210 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
81,152 KB
testcase_01 AC 65 ms
70,016 KB
testcase_02 AC 67 ms
66,944 KB
testcase_03 AC 67 ms
69,120 KB
testcase_04 AC 58 ms
63,744 KB
testcase_05 AC 94 ms
87,424 KB
testcase_06 AC 86 ms
82,048 KB
testcase_07 AC 71 ms
73,216 KB
testcase_08 AC 53 ms
62,208 KB
testcase_09 AC 62 ms
67,840 KB
testcase_10 AC 76 ms
76,416 KB
testcase_11 AC 74 ms
75,008 KB
testcase_12 AC 82 ms
78,976 KB
testcase_13 AC 54 ms
62,848 KB
testcase_14 AC 52 ms
60,416 KB
testcase_15 AC 89 ms
83,712 KB
testcase_16 AC 96 ms
87,296 KB
testcase_17 AC 85 ms
81,024 KB
testcase_18 AC 61 ms
66,432 KB
testcase_19 AC 87 ms
82,176 KB
testcase_20 AC 97 ms
87,808 KB
testcase_21 AC 96 ms
88,064 KB
testcase_22 AC 96 ms
87,808 KB
testcase_23 AC 96 ms
87,424 KB
testcase_24 AC 97 ms
88,320 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