题目要求
题目链接
STL有一个函数next_permutation()
,直接给出下一个序列。
想自己做的话,建议学习康托展开。
AC代码#include
#include
using namespace std;
int nums[10010];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i > nums[i];
}
while (m--) {
next_permutation(nums, nums+n);
}
for (int i = 0; i
关注
打赏
热门博文
- 【Linux】Ubuntu20.04安装和卸载MySQL8
- 【Linux】Ubuntu 20.04 报错 curl: (23) Failure writing output to destination 的解决方法
- 【Java】JUnit 4.13.2 警告 ‘assertEquals(double, double)‘ is deprecated 的解决方法
- 【JavaScript】处理 @parcel/transformer-js: Browser scripts cannot have imports or exports.
- 【Python】处理TypeError: Plain typing.NoReturn is not valid as type argument
- 【Python】Matplotlib可视化50例
- 【C语言】C语言修改MySQL数据库
- 【Java】从默认包导入类和对象报错的解决方法
- 【Java】panel.getGraphics()报错空指针异常的解决方法
- 【Java】IDEA编译Java项目报错 java: 找不到符号 的解决方法