划分序列
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
给定一个长度为 的序列 ,你需要划分这个序列。先任意选择若干个位置,假定你选择了 个位置,这些位置分别为 ,这一次划分的代价为下面两个量中的最大值:
- .
- $\max\limits_{i=0}^{m}{\large{\sum\limits_{j=B_i+1}^{B_{i+1}-1}}{A_j}}$ 。 特别的,定义,同时,若 ,则在原式中 一项的值你应当视为 0。
即为:你选择了若干位置,这些位置将原序列分隔成了若干段。代价是你选择的这些位置的元素和与每一段中所有的元素和的最大值。
给定 与序列 ,求最小分隔代价。
输入格式
第一行输入。
第二行输入个数字。
输出格式
一个数字表示答案。
6
1 4 5 3 3 2
7
5
1 2 3 4 5
5
6
4 1 6 3 10 7
11
数据范围
对于20%的数据:保证。
对于60%的数据:保证。
对于100%的数据:保证。
0906
- Status
- Done
- Rule
- IOI
- Problem
- 7
- Start at
- 2025-9-6 14:00
- End at
- 2025-9-6 18:00
- Duration
- 4 hour(s)
- Host
- Partic.
- 61