#P3795. 钟氏映射
钟氏映射
Description
Let . Let be a mapping from to . Count the number of distinct mappings that satisfy . Since the answer may be large, output the result modulo .
Input Format
A single positive integer .
Output Format
Output the number of distinct mappings satisfying , modulo .
3
4
Hint
For , the four mappings are:
| f(1) | f(2) | f(3) |
|---|---|---|
| 1 | 2 | 3 |
| 3 | 2 | |
| 2 | 1 | 3 |
| 3 | 2 | 1 |
Constraints:
- For 20% of the testdata, .
- For the other 80% of the testdata, .
Memory 20 MB... (I initially set 1 MB and got myself into trouble).
Translated by ChatGPT 5
京公网安备 11011102002149号