Problem 2662 --Search - Allocation

2662: Search - Allocation

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $107$ 正确数量 $40$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 STL 二分答案 二分
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.
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.
Print the minimum value of P in a line.
5 3
8
1
7
3
9
10

1≤ n≤ 100,000

1≤ k≤ 100,000 

1≤ wi≤ 10,000

推荐代码 查看2662 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$19 $ms] Void 1101531 2024-05-05 00:25:00
内存最少[$1544 $KB] q 749104 2021-05-13 22:19:10
第一AC AOJ大管家 338591 2018-12-05 21:37:07
第一挑战 AOJ大管家 338591 2018-12-05 21:37:07

赛题来源/所属竞赛 会津大学《挑战数据结构与算法》 挑战数据结构与算法

竞赛编号 竞赛名称 竞赛时间 访问比赛
1817 安科ACM集训队-2024(2)二分算法 2024-05-02 10:00:00 请登录
1646 安科ACM集训队-2021(2)二分算法 2021-05-02 10:00:00 请登录