結果
| 問題 | No.21 平均の差 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-09 21:43:48 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 129 ms |
| コンパイル使用メモリ | 77,504 KB |
| 最終ジャッジ日時 | 2025-12-03 13:40:47 |
|
ジャッジサーバーID (参考情報) |
judge5 / 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