Pathetic_loser's blog

By Pathetic_loser, 10 years ago, In English

Problem

Some help/hint would be greatly appreciated :)

  • Vote: I like it
  • +13
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +9 Vote: I do not like it

There are at most 11 prime numbers less than sqrt(N). Try all possible assignments of these switches (211 ways). Each lamp is now attached to at most 1 unassigned switch (those are greater than sqrt(N)) and we can solve it by greedy approach (count the number of on/off lamps for each switch).