首页 > 其他 > 详细

[LintCode] Copy Books 复印书籍

时间:2016-07-24 00:27:21      阅读:504      评论:0      收藏:0      [点我收藏+]

 

Given an array A of integer with size of n( means n books and number of pages of each book) and k people to copy the book. You must distribute the continuous id books to one people to copy. (You can give book A[1],A[2] to one people, but you cannot give book A[1], A[3] to one people, because book A[1] and A[3] is not continuous.) Each person have can copy one page per minute. Return the number of smallest minutes need to copy all the books.

Example

Given array A = [3,2,4], k = 2.

Return 5( First person spends 5 minutes to copy book 1 and book 2 and second person spends 4 minutes to copy book 3. )

Challenge 

Could you do this in O(n*k) time ?

 

 

 

[LintCode] Copy Books 复印书籍

原文:http://www.cnblogs.com/grandyang/p/5699874.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!