結果

問題 No.609 Noelちゃんと星々
ユーザー titiatitia
提出日時 2023-12-28 03:54:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 112 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 20,968 KB
最終ジャッジ日時 2023-12-28 03:54:48
合計ジャッジ時間 4,260 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
18,368 KB
testcase_01 AC 59 ms
14,188 KB
testcase_02 AC 49 ms
12,952 KB
testcase_03 AC 57 ms
13,856 KB
testcase_04 AC 42 ms
11,904 KB
testcase_05 AC 109 ms
20,308 KB
testcase_06 AC 98 ms
18,860 KB
testcase_07 AC 67 ms
15,256 KB
testcase_08 AC 35 ms
11,136 KB
testcase_09 AC 55 ms
13,372 KB
testcase_10 AC 82 ms
16,592 KB
testcase_11 AC 74 ms
16,028 KB
testcase_12 AC 86 ms
17,708 KB
testcase_13 AC 38 ms
11,392 KB
testcase_14 AC 32 ms
10,624 KB
testcase_15 AC 98 ms
19,136 KB
testcase_16 AC 110 ms
20,640 KB
testcase_17 AC 94 ms
18,392 KB
testcase_18 AC 48 ms
12,784 KB
testcase_19 AC 100 ms
18,864 KB
testcase_20 AC 117 ms
20,968 KB
testcase_21 AC 114 ms
20,968 KB
testcase_22 AC 121 ms
20,968 KB
testcase_23 AC 114 ms
20,968 KB
testcase_24 AC 114 ms
20,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=sorted(map(int,input().split()))

x=A[len(A)//2]
ANS=0
for a in A:
    ANS+=abs(x-a)
print(ANS)
0