主页
题目
状态
排名
OI排名
统计
题解
请登录
常用链接
AOJ考试平台
老赵的Gitee代码
编译原理模拟考试平台
Java技术手册
FCC网站
菜鸟网
在线工具箱
字节豆包GPT
代码可视化
力扣网
牛客网
洛谷
杭电OJ
CodeForce
隐藏编译器
Problem D: 4_D : Allocation
上一题
正确率: $37.96\%$
下一题
Time Limit
$1$ 秒/Second(s)
Memory Limit
$512$ 兆字节/Megabyte(s)
提交总数
$108$
正确数量
$41$
"
裁判形式
标准裁判/Standard Judge
我的状态
尚未尝试
难度
分类标签
STL
二分答案
二分
×
为本题添加算法分类(请不要超过5个)
当前分类(单击移除):
STL
二分答案
二分
单击选择分类:
Description
You are given n packages of wi kg from a belt conveyor in order (i=0,1,...n−1). You should load all packages onto k trucks which have the common maximum load PP. Each truck can load consecutive packages (more than or equals to zero) from the belt conveyor unless the total weights of the packages in the sequence does not exceed the maximum load P. Write a program which reads n, k and wi, and reports the minimum value of the maximum load PP to load all packages from the belt conveyor.
Input
In the first line, two integers n and k are given separated by a space character. In the following n lines, wi are given respectively.
Output
Print the minimum value of P in a line.
Sample Input
复制
5 3 8 1 7 3 9
Sample Output
复制
10
提示
<p> 1≤ n≤ 100,000 </p> <p> 1≤ k≤ 100,000 </p> <p> 1≤ wi≤ 10,000 </p>
AOJ
Please Login