結果
| 問題 | No.615 集合に分けよう |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-03-18 19:34:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 2,000 ms |
| コード長 | 202 bytes |
| 記録 | |
| コンパイル時間 | 239 ms |
| コンパイル使用メモリ | 95,968 KB |
| 実行使用メモリ | 94,080 KB |
| 最終ジャッジ日時 | 2026-07-07 06:17:27 |
| 合計ジャッジ時間 | 4,693 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 26 |
ソースコード
from itertools import pairwise
N, K = map(int, input().split())
A = list(map(int, input().split()))
bs = []
for a, b in pairwise(sorted(A)):
bs.append(b-a)
ans = sum(sorted(bs)[:N-K])
print(ans)
norioc