結果

問題 No.615 集合に分けよう
ユーザー 👑 H20H20
提出日時 2020-12-01 14:57:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 166 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 86,428 KB
最終ジャッジ日時 2023-10-11 03:35:15
合計ジャッジ時間 5,931 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,308 KB
testcase_01 AC 76 ms
71,400 KB
testcase_02 AC 72 ms
71,304 KB
testcase_03 AC 72 ms
71,308 KB
testcase_04 AC 73 ms
71,384 KB
testcase_05 AC 72 ms
71,152 KB
testcase_06 AC 72 ms
71,492 KB
testcase_07 AC 72 ms
71,416 KB
testcase_08 AC 72 ms
71,584 KB
testcase_09 AC 74 ms
71,304 KB
testcase_10 AC 73 ms
71,552 KB
testcase_11 AC 74 ms
71,404 KB
testcase_12 AC 74 ms
71,152 KB
testcase_13 AC 73 ms
71,648 KB
testcase_14 AC 73 ms
71,388 KB
testcase_15 AC 91 ms
76,496 KB
testcase_16 AC 106 ms
85,556 KB
testcase_17 AC 105 ms
86,168 KB
testcase_18 AC 104 ms
86,272 KB
testcase_19 AC 106 ms
86,124 KB
testcase_20 AC 105 ms
86,428 KB
testcase_21 AC 103 ms
86,260 KB
testcase_22 AC 102 ms
85,744 KB
testcase_23 AC 91 ms
84,668 KB
testcase_24 AC 103 ms
85,880 KB
testcase_25 AC 71 ms
71,292 KB
testcase_26 AC 73 ms
71,464 KB
testcase_27 AC 84 ms
84,300 KB
testcase_28 AC 84 ms
84,060 KB
testcase_29 AC 90 ms
85,916 KB
testcase_30 AC 89 ms
85,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
H = []
for i in range(N-1):
    H.append(A[i+1]-A[i])
H.sort()
print(sum(H[0:len(H)-X+1]))
0