結果

問題 No.609 Noelちゃんと星々
ユーザー tcltktcltk
提出日時 2021-01-19 01:32:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 594 bytes
コンパイル時間 918 ms
コンパイル使用メモリ 86,744 KB
実行使用メモリ 108,712 KB
最終ジャッジ日時 2023-08-21 12:04:52
合計ジャッジ時間 9,728 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 293 ms
104,448 KB
testcase_01 AC 272 ms
99,056 KB
testcase_02 AC 265 ms
96,800 KB
testcase_03 AC 268 ms
98,344 KB
testcase_04 AC 256 ms
93,104 KB
testcase_05 AC 293 ms
108,712 KB
testcase_06 AC 287 ms
104,728 KB
testcase_07 AC 273 ms
101,340 KB
testcase_08 AC 257 ms
92,968 KB
testcase_09 AC 269 ms
97,796 KB
testcase_10 AC 279 ms
101,932 KB
testcase_11 AC 277 ms
102,040 KB
testcase_12 AC 283 ms
102,856 KB
testcase_13 AC 256 ms
92,988 KB
testcase_14 AC 256 ms
92,976 KB
testcase_15 AC 293 ms
106,396 KB
testcase_16 AC 295 ms
108,524 KB
testcase_17 AC 285 ms
104,248 KB
testcase_18 AC 265 ms
96,920 KB
testcase_19 AC 286 ms
104,100 KB
testcase_20 AC 296 ms
108,644 KB
testcase_21 AC 294 ms
108,560 KB
testcase_22 AC 296 ms
108,532 KB
testcase_23 AC 295 ms
108,564 KB
testcase_24 AC 298 ms
108,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)


def main():
    N = int(input())
    Y = sorted(list(map(int, input().split())))

    n = N // 2
    d = sum(abs(y - Y[n]) for y in Y)
    print(d)

if __name__ == '__main__':
    main()
0