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.
Auto comment: topic has been updated by Freakboy (previous revision, new revision, compare).
Auto comment: topic has been updated by Freakboy (previous revision, new revision, compare).