結果
問題 | No.615 集合に分けよう |
ユーザー |
|
提出日時 | 2017-12-22 17:23:09 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 91 ms / 2,000 ms |
コード長 | 222 bytes |
コンパイル時間 | 754 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 11,484 KB |
最終ジャッジ日時 | 2024-12-17 23:13:23 |
合計ジャッジ時間 | 2,817 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 26 |
ソースコード
#yuki_615 n,k=map(int,raw_input().split()) a=map(int,raw_input().split()) a1=sorted(a) b=[] for i in xrange(1,n): b.append(a1[i]-a1[i-1]) b1=sorted(b,reverse=True) res=sum(b1) for i in xrange(k-1): res-=b1[i] print res