suggi_d_luffy's blog

By suggi_d_luffy, history, 10 years ago, In English

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?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
10 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You can print it in reversed order, here is what I did: http://ideone.com/XDnQnT

  • »
    »
    10 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    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.

    • »
      »
      »
      10 years ago, hide # ^ |
      Rev. 2  
      Vote: I like it 0 Vote: I do not like it

      Is your binary search correct? The hi is exclusive, so you should initialize hi with sum+1.