HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


03B. 50720 - Permutations (2)

Guest
• Discussion of problem (1)

Volume problems

• 04E. 50609 - Long division
• 04F. 50636 - Brackets
• 01A. 50650 - Prime numbers
• 01E. 50661 - nth Power of a Digit
• 02B. 50625 - Permutations
• 02C. 50626 - The route
• 02F. 50647 - Spiral
• 03A. 50633 - The prime factors
• 03B. 50720 - Permutations (2)
• 03F. 50616 - Snake
• 01B. 50600 - Expression
• 01C. 50601 - Increasing sequence
• 01D. 50660 - Triangle and the point
• 02A. 50662 - Prime numbers (2)
• 02E. 50607 - Long sum
• 03D. 50666 - The card and envelope
• 03E. 50606 - Long product

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Author: Fyodor Menshikov. Difficulty Alpha

Permutations (2)

Russian

You are given a string with length M. You have to show all the possible permutations of the string.

Input
You will be given a string of length M.

Output
You have to show each permutation of the string in a new line. The order in which you output the permutations is not important. However, you shouldn’t show repetitions (the same permutation twice) or lines that aren’t permutations of the original string.
Restrictions

2 ≤ M ≤ 8; The string may contain both Latin alphabet letters or numbers.

Input 1

Input 2

AB

122

Output 1

Output 2

AB
BA

122
212
221

 

Äëÿ îòïðàâêè ðåøåíèé íåîáõîäèìî âûïîëíèòü âõîä.

www.contester.ru