HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Exhaustive search & Backtracking > problem:


50720 - Permutations (2)

Guest
• Discussion of problem (1)

Section problems

• 51067 - Jumping frog
• 51142 - Jump Min Value
• 51082 - Sum is equal to K - 1
• Post Office Delivery
• 50506 - The Biggest Island
• 50718 - Elevator
• 50593 - Transporter
• 50600 - Expression
• 50720 - Permutations (2)

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