結果

問題 No.609 Noelちゃんと星々
ユーザー ttrttr
提出日時 2020-02-22 20:18:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 128 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,852 KB
最終ジャッジ日時 2024-04-18 03:03:33
合計ジャッジ時間 3,275 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
18,976 KB
testcase_01 AC 59 ms
14,720 KB
testcase_02 AC 48 ms
13,608 KB
testcase_03 AC 63 ms
14,588 KB
testcase_04 AC 42 ms
12,544 KB
testcase_05 AC 105 ms
20,952 KB
testcase_06 AC 93 ms
19,520 KB
testcase_07 AC 72 ms
16,008 KB
testcase_08 AC 39 ms
11,904 KB
testcase_09 AC 58 ms
14,028 KB
testcase_10 AC 84 ms
17,240 KB
testcase_11 AC 69 ms
16,684 KB
testcase_12 AC 82 ms
18,520 KB
testcase_13 AC 36 ms
12,160 KB
testcase_14 AC 35 ms
11,392 KB
testcase_15 AC 99 ms
19,916 KB
testcase_16 AC 129 ms
21,292 KB
testcase_17 AC 95 ms
19,040 KB
testcase_18 AC 45 ms
13,444 KB
testcase_19 AC 98 ms
19,388 KB
testcase_20 AC 110 ms
21,852 KB
testcase_21 AC 116 ms
21,720 KB
testcase_22 AC 112 ms
21,724 KB
testcase_23 AC 131 ms
21,852 KB
testcase_24 AC 117 ms
21,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
Y = [int(y) for y in input().split()]

Y.sort()
x = Y[N//2]
ans = 0
for y in Y:
    ans += abs(y-x)
print(ans)
0