Freakboy's blog

By Freakboy, history, 5 months ago, In English

Hey Guys, was recently trying to solve Problem I of this contest and this is the code for the same.

My Intutiton:

For every size of buffer, we will try to calculate the length of cycle in which the buffer is filled and it is emptied. Calculate the total number of such cycles and if it is = min number of cycles, then it can be the possible buffer length.I used binary search to find such cycle.

Min Number of cycles = total bandwidth/max bufher length

max buffer length=p*d

Code

It gives WA on tc 7, any help would be deeply appreciated.

Full text and comments »

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