Ad
  • Custom User Avatar

    Powerful Tom cat can catch a lot of mice every day, in order to show his naughtiness and generosity, let mouse number off, first batch eats the numbers of single. Then re-queue, The second batch still eats the numbers of single. The third batch is the same, until there's only one left, and it can survive.

    Can be changed to:

    Powerful Tom catches a lot of mice every day. But in order to show his naughtiness and generosity he always lets one mouse go. First he eats each mouse in the odd positions, rounds up the remaining mice and repeats the process, until there is just one mouse left.

    Still clunky but I didn't want to change the structure.

  • Custom User Avatar

    Needs performance tag.

    Requires O(log n) solution; O(n) won't do. That's ok, but solvers deserve fair warning about that.

  • Default User Avatar

    The description is totally incomprehensible. I still have no idea how it could be related to what's tested.