結果
問題 |
No.615 集合に分けよう
|
ユーザー |
|
提出日時 | 2021-10-21 22:59:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 165 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 74,240 KB |
最終ジャッジ日時 | 2024-09-21 19:53:39 |
合計ジャッジ時間 | 3,661 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 26 |
ソースコード
N,K=map(int,input().split()) A=list(map(int,input().split())) A=sorted(A) d=[A[i+1]-A[i] for i in range(N-1)] d=sorted(d,reverse=True) print(A[-1]-A[0]-sum(d[:K-1]))