Problem Link : Copying Books
I have arrived at the minimum of the maximum values.But I am not able to figure out how to partition the books.
My Solution : Ideone
Please guide me as to how to print the partitioning of the books.Do I need to know more to find out how to partition? or is this just enough to compute the partitioning.If this is enough,how do I compute it?
You can print it in reversed order, here is what I did: http://ideone.com/XDnQnT
Its giving me wa.The link int the question has the updated solution.I checked the limits, int should do fine but still giving me wa.
Is your binary search correct? The
hi
is exclusive, so you should initializehi
withsum+1
.