結果

問題 No.21 平均の差
ユーザー ieneko18ieneko18
提出日時 2016-10-12 21:53:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-01 19:42:33
合計ジャッジ時間 1,223 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,880 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 31 ms
10,880 KB
testcase_09 AC 32 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil
n=int(input())
k=int(input())
v=sorted([int(input()) for i in range(n)])
if n%k==n-1:
    print(ceil(max(sum(v[-(n//k+1):])/(n//k+1)-sum(v[:n//k])/(n//k),sum(v[-(n//k):])/(n//k)-sum(v[:n//k+1])/(n//k+1))))
else:
    print(ceil(sum(v[-(n//k):])/(n//k)-sum(v[:n//k])/(n//k)))
0