結果

問題 No.615 集合に分けよう
ユーザー 👑 KazunKazun
提出日時 2020-11-13 16:05:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 149 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 87,208 KB
実行使用メモリ 84,104 KB
最終ジャッジ日時 2023-09-30 02:08:37
合計ジャッジ時間 4,459 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,628 KB
testcase_01 AC 68 ms
71,636 KB
testcase_02 AC 68 ms
71,440 KB
testcase_03 AC 70 ms
71,252 KB
testcase_04 AC 70 ms
71,632 KB
testcase_05 AC 73 ms
71,288 KB
testcase_06 AC 74 ms
71,252 KB
testcase_07 AC 75 ms
71,384 KB
testcase_08 AC 73 ms
71,216 KB
testcase_09 AC 74 ms
71,356 KB
testcase_10 AC 75 ms
71,544 KB
testcase_11 AC 75 ms
71,340 KB
testcase_12 AC 74 ms
71,572 KB
testcase_13 AC 76 ms
71,212 KB
testcase_14 AC 78 ms
71,340 KB
testcase_15 AC 83 ms
76,280 KB
testcase_16 AC 98 ms
83,552 KB
testcase_17 AC 100 ms
83,880 KB
testcase_18 AC 101 ms
83,976 KB
testcase_19 AC 101 ms
84,104 KB
testcase_20 AC 99 ms
83,888 KB
testcase_21 AC 100 ms
83,676 KB
testcase_22 AC 103 ms
83,188 KB
testcase_23 AC 87 ms
82,380 KB
testcase_24 AC 100 ms
83,536 KB
testcase_25 AC 70 ms
71,628 KB
testcase_26 AC 70 ms
71,108 KB
testcase_27 AC 80 ms
81,916 KB
testcase_28 AC 82 ms
81,952 KB
testcase_29 AC 86 ms
83,656 KB
testcase_30 AC 84 ms
83,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort()

X=[A[i+1]-A[i] for i in range(N-1)]
X.sort(reverse=True)

print(sum(X[K-1:]))
0