TC FairTournament

From Algorithmist

Jump to: navigation, search

[edit] Summary

Given integers n and k, determine the number of permutations σ of the numbers {1, 2, \ldots, n} with |\sigma(i)-i| \leq k, for all 1 \leq i \leq n.

From TopCoder Single Round Match 344.

Personal tools