結果

問題 No.21 平均の差
ユーザー roiti46roiti46
提出日時 2015-02-09 21:43:48
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 401 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 6,688 KB
実行使用メモリ 10,440 KB
最終ジャッジ日時 2023-09-05 21:17:38
合計ジャッジ時間 8,767 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,136 KB
testcase_01 AC 289 ms
6,092 KB
testcase_02 AC 1,276 ms
5,992 KB
testcase_03 AC 12 ms
5,992 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools,math
N = int(raw_input())
K = int(raw_input())
n = [int(raw_input()) for _ in xrange(N)]
ans = 0
for group in itertools.product(xrange(K),repeat=N):
    if not all(group.count(i) for i in xrange(K)): continue
    ave = [0.0]*K
    for i in xrange(N): ave[group[i]] += n[i]
    for i in xrange(K): ave[i] /= group.count(i)
    ans = max(ans,int(math.ceil(max(ave)-min(ave))))
print ans
0