elizabeth_zou_fanboi's blog

By elizabeth_zou_fanboi, history, 9 hours ago, In English

a permutation is valid only if |ai — i| != k for all 1<=i<=n. Count the number of valid permutations.

Constraints: 2 ≤ N ≤ 2000

1 ≤ K ≤ N − 1

Full text and comments »

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