#A. 数字排列

    Type: Default 1000ms 128MiB

数字排列

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.

题目描述

按照字典序输出自然数 11nn 所有不重复的排列,即 nn 的全排列,要求所产生的任一数字序列中不允许出现重复的数字。

输入格式

一个整数 nn

输出格式

1n1 \sim n 组成的所有不重复的数字序列,每行一个序列。

每个数字保留 55 个场宽。

输入输出样例 #1

输入 #1

3

输出 #1

    1    2    3
    1    3    2
    2    1    3
    2    3    1
    3    1    2
    3    2    1

零基础——深度优先搜索

Not Claimed
Status
Done
Problem
4
Open Since
2025-3-15 12:00
Deadline
2025-3-23 23:59
Extension
24 hour(s)