全排列问题01
No testdata at current.
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.
题目背景
经典递归问题
题目描述
输出自然数1到n所有不重复的排列,即n的全排列,要求所产生的任一数字序列中不允许出现重复的数字。
输入输出说明
输入说明
输入一行,一个正整数n(1≤n≤9)
输出说明
由1~n组成的所有不重复的数字序列,每行一个序列。每个数字保持5个场宽。
题目样例
样例输入
3
样例输出
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
数据范围
- 对于 100% 的数据,满足 1≤n≤9。
暑假阶段测试
- Status
- Done
- Rule
- XCPC
- Problem
- 7
- Start at
- 2024-8-10 14:00
- End at
- 2024-8-10 17:00
- Duration
- 3 hour(s)
- Host
- Partic.
- 8