Data Structures & AlgorithmsVery hardICPC regional · DP optimisation

Problem: Which property must a function satisfy for the Knuth optimisation of DP to apply?

  1. A. Convexity of the input array
  2. B. Integer outputs only
  3. C. Quadrangle inequality (monotone optimal split points)
  4. D. Non-negative weights only

Correct answer: C. Quadrangle inequality (monotone optimal split points)

The quadrangle inequality makes optimal split points monotone, which shrinks the search range.

More Coding Interview Problems questions

Exams that ask this topic