#P1233. 土拨鼠进监狱
土拨鼠进监狱
Background
土拨鼠进监狱了,他需要写出n的全排列才能出狱。
Description
给出n,输出n的全排列。
Format
Input
一行,一个数n
Output
行,每行是n的一个全排列,按字典序输出。
Samples
3
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
Limitation
1秒,256mb。
土拨鼠进监狱了,他需要写出n的全排列才能出狱。
给出n,输出n的全排列。
一行,一个数n
n!行,每行是n的一个全排列,按字典序输出。
3
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
1秒,256mb。n<=8
By signing up a acjudge universal account, you can submit code and join discussions in all online judging services provided by us.