infomaniac's blog

By infomaniac, history, 7 years ago, In English

I followed the official editorial for this and I seem to be getting WA on a handful of cases. I am using an optimzed version of the algorithm in the editorial. The logic is that for every zombie, we can construct 4 squares of side 'r' with the point at each of the square corners. So select any two points and for all 16 sets of square for these two, find the points in the union of these two squares and output the max. The exact code is given here

Full text and comments »

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

By infomaniac, history, 7 years ago, In English

Hi, I recently submitted this which gives RTE on CF but runs perfectly fine on the test case on my local system. Any clues ?

Full text and comments »

  • Vote: I like it
  • -19
  • Vote: I do not like it

By infomaniac, history, 7 years ago, In English

I am stuck at the following question Problem Statement. I have thought about this for some time and then looked at some clues for the problem because I could not come up with a solution. My understanding is that this is a special case of "Bin Packing" problems which in general are NP-Hard. Looking at this idea in particular CodeForces Blog, I am unable to understand why this even works optimally here. In particular how can we prove that this algorithm is optimal ?

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it