Revision en2, by Freakboy, 2024-08-12 15:16:19

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.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Freakboy 2024-08-12 15:18:32 95
en2 English Freakboy 2024-08-12 15:16:19 57
en1 English Freakboy 2024-08-12 15:15:47 3118 Initial revision (published)