Facebook HackerCup 2017 Round 1 Fighting Zombies Doubt

Revision en1, by infomaniac, 2017-01-21 12:21:59

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

Tags facebook hacker cup, #geometry, greedy, #c++

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English infomaniac 2017-01-21 12:21:59 535 Initial revision (published)