結果

問題 No.615 集合に分けよう
ユーザー MaboyMaboy
提出日時 2018-03-06 18:14:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 135 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 11,796 KB
実行使用メモリ 15,860 KB
最終ジャッジ日時 2023-10-19 23:22:33
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,120 KB
testcase_01 AC 29 ms
10,120 KB
testcase_02 AC 29 ms
10,120 KB
testcase_03 WA -
testcase_04 AC 30 ms
10,120 KB
testcase_05 AC 29 ms
10,120 KB
testcase_06 AC 29 ms
10,120 KB
testcase_07 WA -
testcase_08 AC 29 ms
10,124 KB
testcase_09 AC 29 ms
10,124 KB
testcase_10 AC 30 ms
10,120 KB
testcase_11 AC 29 ms
10,120 KB
testcase_12 AC 29 ms
10,124 KB
testcase_13 AC 30 ms
10,184 KB
testcase_14 AC 30 ms
10,260 KB
testcase_15 WA -
testcase_16 AC 90 ms
15,728 KB
testcase_17 WA -
testcase_18 AC 90 ms
15,728 KB
testcase_19 AC 90 ms
15,728 KB
testcase_20 AC 89 ms
15,728 KB
testcase_21 AC 89 ms
15,860 KB
testcase_22 AC 88 ms
15,728 KB
testcase_23 AC 55 ms
13,840 KB
testcase_24 AC 76 ms
15,580 KB
testcase_25 AC 30 ms
10,120 KB
testcase_26 AC 29 ms
10,120 KB
testcase_27 AC 43 ms
11,268 KB
testcase_28 AC 43 ms
11,268 KB
testcase_29 AC 52 ms
15,472 KB
testcase_30 AC 53 ms
15,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
a=list(sorted(map(int,input().split())))
print(sum(sorted([a[i]-a[i-1] for i in range(1,len(a))])[:-~-k]))
0