結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-02-08 06:44:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 512 bytes |
| コンパイル時間 | 209 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 14,008 KB |
| 最終ジャッジ日時 | 2024-06-22 23:56:13 |
| 合計ジャッジ時間 | 9,119 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 TLE * 1 -- * 5 |
ソースコード
N = int(input())
K = int(input())
n = list(int(input()) for _ in range(N))
ans = 0
for bit in range(K**N):
x = bit
Group = [[] for _ in range(K)]
for i in range(N):
Group[x%K].append(n[i])
x //= K
flg = False
for i in range(K):
if not Group[i]:
flg = True
if flg:
continue
Set = []
for i in range(K):
Set.append(sum(Group[i]) / len(Group[i]))
Ma = max(Set)
Mi = min(Set)
ans = max(ans, int(Ma - Mi + 0.5))
print(ans)
tnodino