report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Permutation - FlandreOJ: Flandre Online Judge

Permutation

Time limit: 1000 ms
Memory limit: 256 MB
Find all permutation of the set $S=\\{1,2,...,n\\}$. ### Input - A single line contains an integer $n$. ### Output - Print all permutations of $S$, in lexicographic order. ### Constraints - $1 \le n \le 9$. ### Example Input: ``` 3 ``` Output: ``` 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 ```
Permutation
Permutation
Scheduling
Topic
Complete Search
Rating 800
Solution (1) Solution