排列计数2
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Problem D. 排列计数2 (countb.c/cpp)
Time limit: 1 second Memory limit: 256 megabytes**
问题描述
给定一个长度为 的排列,若 为好的当且仅当 的最长上升子序列长度不超过2。 当然,如果只是这样未免太索然无味了。所以小洞给你增加了一条限制, 他希望你能帮他求出,满足 的好的排列数。
Input
一行三个整数n, A,B, 表示排列的长度和小洞的限制。
Output
输出一个整数,表示方案数对 取模的结果。
Examples
输入样例1:
3 1 1
输出样例1:
1
唯一符合条件的排列是(1, 3, 2)
输入样例2:
12 3 4
输出样例2:
5390
Notes
本题共10 个测试点,其中第i 个测试点,。 对100% 的数据,
提高组测试改题
- Status
- Done
- Rule
- IOI
- Problem
- 16
- Start at
- 2023-7-22 13:30
- End at
- 2023-7-26 17:30
- Duration
- 100 hour(s)
- Host
- Partic.
- 13