結果
問題 |
No.21 平均の差
|
ユーザー |
![]() |
提出日時 | 2022-02-12 15:53:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 700 bytes |
コンパイル時間 | 167 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 16,000 KB |
最終ジャッジ日時 | 2024-06-28 18:04:43 |
合計ジャッジ時間 | 7,306 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 7 |
ソースコード
from itertools import permutations N = int(input()) K = int(input()) n = list(int(input()) for _ in range(N)) L = [i for i in range(N)] ans = 0 for A in range(1,N+1): for B in range(1,N+1): if N - A - B < K - 2: continue for X in permutations(L, A): for Y in permutations(L, B): flg = True for x in X: if x in Y: flg = False break if flg: P = sum([n[i] for i in X]) / len(X) Q = sum([n[i] for i in Y]) / len(Y) R = int(P - Q + 0.9) ans = max(ans, R) print(ans)