远端评测题 1000ms 125MiB

全排列问题

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Description

Output, in lexicographic order, all non-repeating permutations of the natural numbers 11 to nn, i.e., the full set of permutations of 11 to nn. No generated sequence may contain repeated numbers.

Input Format

A single integer nn.

Output Format

All non-repeating sequences composed of 1n1 \sim n, one sequence per line. Each number should be printed in a field of width 55.

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

Hint

1n91 \leq n \leq 9

Translated by ChatGPT 5

第 23 课:枚举算法-排列枚举

未认领
状态
已结束
题目
8
开始时间
2026-7-2 17:00
截止时间
2026-7-9 17:00
可延期
24 小时