結果
問題 |
No.615 集合に分けよう
|
ユーザー |
![]() |
提出日時 | 2020-05-25 21:43:11 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 101 ms / 2,000 ms |
コード長 | 187 bytes |
コンパイル時間 | 136 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 16,280 KB |
最終ジャッジ日時 | 2024-10-13 02:15:10 |
合計ジャッジ時間 | 3,252 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 26 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() n,k=map(int,input().split()) A=sorted([int(i) for i in input().split()]) print(sum(sorted([A[i]-A[i-1] for i in range(1,n)])[:n-k]))