結果
問題 |
No.21 平均の差
|
ユーザー |
|
提出日時 | 2015-02-09 21:44:12 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 401 bytes |
コンパイル時間 | 1,488 ms |
コンパイル使用メモリ | 76,692 KB |
実行使用メモリ | 154,684 KB |
最終ジャッジ日時 | 2024-06-23 16:39:11 |
合計ジャッジ時間 | 8,415 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