Блог пользователя infomaniac

Автор infomaniac, история, 8 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор infomaniac, история, 8 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • -19
  • Проголосовать: не нравится

Автор infomaniac, история, 8 лет назад, По-английски

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 ?

Полный текст и комментарии »

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится