結果
| 問題 |
No.615 集合に分けよう
|
| コンテスト | |
| ユーザー |
kwnwsdnc
|
| 提出日時 | 2018-03-08 14:51:30 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 411 bytes |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 22,928 KB |
| 最終ジャッジ日時 | 2024-10-05 07:50:36 |
| 合計ジャッジ時間 | 4,624 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 13 TLE * 1 -- * 12 |
ソースコード
import sys
ln=list(map(int,input().split()))
N=list(map(int,input().split()))
M=[]
rem=[]
if ln[1]==1:
print(max(N)-min(N))
sys.exit()
elif ln[0]==ln[1]:
print(0)
sys.exit()
for i in range(0,ln[0]):
n=min(N)
M.append(n)
N.remove(n)
for i in range(0,ln[0]-1):
rem.append(M[i+1]-M[i])
ans=0
for i in range(0,ln[0]-ln[1]):
n=min(rem)
ans+=n
rem.remove(n)
print(ans)
kwnwsdnc