链接:点击打开链接
1518: A Permutation Problem
Time Limit: 1 Sec Memory Limit: 32 MBSubmit: 56 Solved: 17
[ Submit][ Status][ Web Board]
Description
A long time ago, there was a boy called ZDD. One day he studied the algorithm of permutation. The meaning of permutation is that choosing M different elements from N different elements, and arranged in a certain order. What’s more, if N=M, it’s called full permutation. For example, if N=3 and the sequence is “1 2 3”. The first permutation is “1 2 3”. The second permutation is “1 3 2”. The third permutation is “2 1 3”. The fourth permutation is “2 3 1”. The fifth permutation is “3 1 2”. And the last permutation is “3 2 1”. Now the problem is coming, Giving a sequence S with N elements, each element is in the range of [1,n], and each of them is different. Can you tell him what is the order number of this sequence in full permutation?