結果

問題 No.609 Noelちゃんと星々
ユーザー kichirb3kichirb3
提出日時 2018-03-24 01:55:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 473 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 21,264 KB
最終ジャッジ日時 2023-09-07 08:16:07
合計ジャッジ時間 3,747 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
18,436 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 56 ms
14,748 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 65 ms
15,480 KB
testcase_08 AC 38 ms
11,400 KB
testcase_09 AC 53 ms
13,568 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 80 ms
17,788 KB
testcase_13 WA -
testcase_14 AC 35 ms
11,008 KB
testcase_15 WA -
testcase_16 AC 100 ms
20,604 KB
testcase_17 AC 85 ms
18,356 KB
testcase_18 AC 50 ms
13,364 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
"""
No.609 Noelちゃんと星々
https://yukicoder.me/problems/no/609

"""
import sys
from sys import stdin
from statistics import median
input = stdin.readline


def solve(stars):
    stars.sort()
    m = median(stars)
    res = [abs(x - m) for x in stars]
    return sum(res)


def main(args):
    _ = input()
    stars = [int(x) for x in input().split()]
    ans = solve(stars)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])
0