結果
問題 |
No.21 平均の差
|
ユーザー |
|
提出日時 | 2015-02-09 21:43:48 |
言語 | Python2 (2.7.18) |
結果 |
TLE
|
実行時間 | - |
コード長 | 401 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 7,068 KB |
実行使用メモリ | 14,008 KB |
最終ジャッジ日時 | 2024-06-23 16:39:02 |
合計ジャッジ時間 | 8,620 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 TLE * 1 -- * 5 |
ソースコード
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