码迷,mamicode.com
首页 > 其他好文 > 详细

[LintCode] Copy Books 复印书籍

时间:2016-07-24 00:30:29      阅读:632      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!