Derangements Small
Computer Mathematics
Hard
2 views
Problem Description
Compute number of derangements for n
Input Format
One integer n.
Output Format
One integer.
Official Solution
Use recurrence D(0)=1,D(1)=0,D(n)=(n-1)*(D(n-1)+D(n-2)).
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!