結果
問題 | No.972 選び方のスコア |
ユーザー |
![]() |
提出日時 | 2023-07-13 08:59:06 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 190 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 109,056 KB |
最終ジャッジ日時 | 2024-09-14 20:36:39 |
合計ジャッジ時間 | 6,506 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 WA * 7 |
ソースコード
N = int(input())A = list(map(int, input().split()))A.sort()ans = 0now = 0for i in range((N-1)//2):now += A[i] + A[-1-i]ans = max(ans, now - 2 * (i + 1) * A[i + 1])print(ans)