dfs--acwing排列数字


#include <iostream>using namespace std;const int N = 10;bool st[N];int path[N];int n;void dfs(int u){ if(u == n){ for(int i = 0;i <

acwing-递归实现排列型枚举


#include <iostream>using namespace std;const int N = 10;int path[N];//保存序列bool state[N];//保存状态int n;void dfs(int u){ if(u>n){ //递归边界