摘要: 题意 定义一个数组的 $cost$ 为数组中出现过的每个元素的最后一个位置减第一个位置。 $$ cost(array) = \sum_{x\in set(array)}last(x) - first(x) $$ 给定一个 $N$ 个数的数组 $A$,将其分为 $K$ 段,求最小 $cost$。 题解 阅读全文
posted @ 2023-05-11 12:53 yHan234 阅读(25) 评论(0) 推荐(0)