結果
問題 | No.21 平均の差 |
ユーザー | roiti46 |
提出日時 | 2015-02-09 21:44:12 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 401 bytes |
コンパイル時間 | 944 ms |
コンパイル使用メモリ | 77,856 KB |
実行使用メモリ | 80,096 KB |
最終ジャッジ日時 | 2023-09-05 21:17:49 |
合計ジャッジ時間 | 8,168 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 79 ms
76,476 KB |
testcase_01 | AC | 207 ms
79,960 KB |
testcase_02 | AC | 548 ms
80,096 KB |
testcase_03 | AC | 76 ms
76,816 KB |
testcase_04 | TLE | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
ソースコード
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