結果

問題 No.609 Noelちゃんと星々
ユーザー Mr.FukuMr.Fuku
提出日時 2018-08-04 20:44:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 121 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 11,812 KB
実行使用メモリ 20,868 KB
最終ジャッジ日時 2023-10-19 21:57:28
合計ジャッジ時間 3,360 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
18,372 KB
testcase_01 AC 59 ms
14,144 KB
testcase_02 AC 49 ms
12,764 KB
testcase_03 AC 57 ms
13,940 KB
testcase_04 AC 42 ms
11,880 KB
testcase_05 AC 108 ms
20,464 KB
testcase_06 AC 95 ms
19,000 KB
testcase_07 AC 67 ms
15,356 KB
testcase_08 AC 36 ms
11,240 KB
testcase_09 AC 52 ms
13,320 KB
testcase_10 AC 78 ms
16,444 KB
testcase_11 AC 73 ms
16,136 KB
testcase_12 AC 86 ms
17,704 KB
testcase_13 AC 39 ms
11,468 KB
testcase_14 AC 34 ms
10,740 KB
testcase_15 AC 98 ms
19,148 KB
testcase_16 AC 114 ms
20,668 KB
testcase_17 AC 93 ms
18,396 KB
testcase_18 AC 49 ms
12,724 KB
testcase_19 AC 96 ms
19,004 KB
testcase_20 AC 113 ms
20,868 KB
testcase_21 AC 115 ms
20,868 KB
testcase_22 AC 116 ms
20,868 KB
testcase_23 AC 113 ms
20,868 KB
testcase_24 AC 114 ms
20,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
y=sorted(map(int,input().split()))
cnt = 0
for i in range(n//2):
    cnt += abs(y[i]-y[-(i+1)])
print(cnt)
0