OTTFF's Blog
Home
Templates
Contests
Solutions
Notes
错位排列
[CF] D. Almost Identity Permutations - Educational Codeforces Round 32
Solutions
Codeforces
组合数学
错位排列
1600
Easy
2025-01-16
https://codeforces.com/contest/888/problem/D 题目大意 问至多有 $k \ (1 \le k \le 4)$ 个位置不对的 $n \ (4 \le n \le 1000)$ 长的排列有多少。 简要题解 因为 $k$ 很小,所以我们直接把 $1 \sim 4$ 的错位排列全写出来,然后直接选位置就可以了。 复杂度 $T$:$O(n)$ $S$:$O(1
…