結果

問題 No.615 集合に分けよう
ユーザー convexineqconvexineq
提出日時 2020-12-27 07:10:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 133 bytes
コンパイル時間 1,246 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 79,160 KB
最終ジャッジ日時 2023-10-26 02:44:08
合計ジャッジ時間 4,207 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,472 KB
testcase_01 AC 37 ms
53,472 KB
testcase_02 AC 38 ms
53,472 KB
testcase_03 AC 37 ms
53,472 KB
testcase_04 AC 38 ms
53,472 KB
testcase_05 AC 38 ms
53,472 KB
testcase_06 AC 38 ms
53,472 KB
testcase_07 AC 37 ms
53,472 KB
testcase_08 AC 37 ms
53,472 KB
testcase_09 AC 38 ms
53,472 KB
testcase_10 AC 37 ms
53,472 KB
testcase_11 AC 38 ms
53,472 KB
testcase_12 AC 37 ms
53,472 KB
testcase_13 AC 38 ms
53,472 KB
testcase_14 AC 39 ms
53,472 KB
testcase_15 AC 48 ms
63,720 KB
testcase_16 AC 73 ms
78,752 KB
testcase_17 AC 75 ms
79,160 KB
testcase_18 AC 74 ms
79,160 KB
testcase_19 AC 74 ms
79,160 KB
testcase_20 AC 75 ms
79,080 KB
testcase_21 AC 74 ms
78,968 KB
testcase_22 AC 73 ms
78,756 KB
testcase_23 AC 63 ms
75,608 KB
testcase_24 AC 74 ms
78,772 KB
testcase_25 AC 39 ms
53,472 KB
testcase_26 AC 39 ms
53,472 KB
testcase_27 AC 56 ms
75,136 KB
testcase_28 AC 56 ms
75,136 KB
testcase_29 AC 59 ms
78,840 KB
testcase_30 AC 59 ms
78,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k = map(int,input().split())
*a, = map(int,input().split())
a.sort()
b = [i-j for i,j in zip(a[1:],a)]
b.sort()
print(sum(b[:n-k]))
0