How to count the number of permutations?

Правка en1, от codemode, 2019-06-20 16:30:05

We are given a sequence : [1,2,...N]. Lets consider all the permutations of the above sequence. Now, a good permutation is defined as the one in which there is atleast one pair of numbers such that a[i]+1=a[i+1]. How to count the number of good permutations ? This problem is from some old contest.

Теги #combinatorics


  Rev. Язык Кто Когда Δ Комментарий
en1 Английский codemode 2019-06-20 16:30:05 343 Initial revision (published)