結果
| 問題 |
No.21 平均の差
|
| コンテスト | |
| ユーザー |
tnodino
|
| 提出日時 | 2022-02-08 06:44:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 512 bytes |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 83,840 KB |
| 最終ジャッジ日時 | 2024-06-22 23:56:50 |
| 合計ジャッジ時間 | 7,088 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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