TC ProblemsToSolve

From Algorithmist
Jump to navigation Jump to search


Given a sequence of up to 50 numbers, find the smallest subset such that

  • the range between the minimum and maximum is sufficiently large,
  • the sequence begins with the first number and has gaps of length at most 1.

From TopCoder Single Round Match 340.


  • Dynamic programming is overkill!
  • Start by choosing two numbers whose range is sufficiently large.