#include <iostream>

#include <vector>
using namespace std;
vector<int> ans;
const int maxn = 1e6 + 10;
int n,vis[maxn];
void dfs(int x)
{
    if(x > n){
        for(auto s : ans)
            cout << s << " ";
        cout << endl;
        return;
    }
    for(int i = 1; i <= n;i++){
        if(!vis[i]){
            ans.push_back(i);
            vis[i] = 1;
            dfs(x + 1);
            vis[i] = 0;
            ans.pop_back();
        }
    }

}
int main()
{
    cin >> n;
    dfs(1);
    return 0;
}

最新文章

  1. .NET单元测试的艺术-2.核心技术
  2. html-webpack-plugin插件的详细介绍和使用
  3. iOS10 UI教程视图的绘制与视图控制器和视图
  4. QT树莓派交叉编译环开发环境搭建(附多个exe工具下载链接)
  5. Ubuntu下远程访问MySQL数据库
  6. 解决由于VNC日志导致服务器磁盘100%
  7. Curl请求慢
  8. css-tips
  9. java第七周动手动脑
  10. (原)tensorflow使用eager在mnist上训练的简单例子
  11. MAC Gradle 下载的问题
  12. 牛刀小试MySQL--innodb_flush_log_at_trx_commit小结
  13. [PHP]PHP的session机制,配置与高级应用
  14. mysql 字符串数值计算 精度丢失
  15. Git项目的初始化
  16. 使用Chrome保存网页为mht文件
  17. 每日英语:China&#39;s Bigger Innovation Problem
  18. Swagger中显示注释
  19. 如何使用Total Recorder录制网上的音乐,如何下载只能试听的歌曲
  20. JS是面向过程、面向对象还是基于对象?面向对象的代码体现

热门文章

  1. liunx 使用crontab定时任务+shell脚本删除tomcat日志elasticsearch日志索引
  2. Codeforces Round #613 (Div. 2) A-E简要题解
  3. js基础 之 引用类型
  4. LUT
  5. 隐写工具F5-steganography的使用
  6. HttpRunner接口自动化框架的使用
  7. Pikachu练习平台(暴力破解)
  8. 程序设计实验:一个Python游戏,体验软件开发。
  9. springboot06(静态资源映射)
  10. python的类定义与实例化