Tags: line like Lin number ICP generation think repeat problemTest instructions
The number of the longest common subsequence >=n-1 after sorting the first k number in the full permutation of nThinking
Let's find out what the last possible results are, and then find out how many permutations can make up these results.
Set the arrangement to S
And because each result can be composed of k!
So the final answer is [1+ (n-1) (n-k)]k! , K<=n
ICPC Shenyang Problem C