Toggle navigation
Contest Tasks
Submissions
Q & A
Dashboard
Sign in
Sign up
1060 . 排列練習
Status
Ranklist
Back to Problems List
TopCoder
temmie
User's AC Ratio
100.0% (
2/2
)
Submission's AC Ratio
50.0% (
2
/
4
)
Tags
Show solution-related tags
c
c25_b
Description
給你一個數字 $n$ ,照字典序印出 $1$ 到 $n$ 的所有排列,但 $1$ 跟 $n$ 不能相鄰
Input Format
輸入只有一行,為一個正整數 $n$ $(2 \le n \le 9)$
Output Format
Sample Input 1
copy
3
Sample Output 1
copy
1 2 3
3 2 1
Hints
Problem Source
Subtasks
No.
Testdata Range
Score
Testdata and Limits
No.
Time Limit (ms)
Memory Limit (VSS, KiB)
Output Limit (KiB)
Subtasks
0
1000
65536
65536
1
1000
65536
65536
2
1000
65536
65536
3
1000
65536
65536
4
1000
65536
65536
5
1000
65536
65536
6
1000
65536
65536
7
1000
65536
65536
Back to Top