ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Data Structures > задача:


50710 - Permutations

Гость
• Обсуждение задачи (1)

Задачи сборника

• 50842 - Minimum Sum Triangle - DP
• 50549 - k-Nearest Neighbours (kNN)
• 50676 - Cinema Millennium
• 50678 - The Jumping Rabbit
• 50306 - Beautiful Numbers
• 50700 - Candidates for the Mayor
• 50692 - How much money?
• 50790 - Fire Alarm
• 50710 - Permutations
• 50709 - k-ary Strings
• 50708 - Binary Strings
• 50694 - The Cheapest Flight
• 50996 - Checkers - the shortest path
• 50770 - Average Depth
• 50291 - Postfix Arithmetic Expressions
• 50775 - Balanced Parenthesis
• 50736 - Top N Donors - 2

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Prepared by Ibrahim Mesecan.

Permutations

Question: In mathematics, permutation relates to the rearrangment of all the members of a set into some sequence or order. Write a program that generates all the permutations of a set of n people.

Input specification
You will be given an integer n. And in the following n lines you will be given the names of n people where 0 ≤ n ≤ 8. Names contain only English uppercase or lowercase characters.

Output specification
Show all possible rearrangements for this n people. Show for every possible arrangment of n people in a line, separated by spaces.

Sample Input I   
3
Red
Green
Blue
Sample Input II   
4
Anila
Erol
Bardhyl
Erisa
Sample Output I   
Red Green Blue
Red Blue Green
Green Red Blue
Green Blue Red
Blue Red Green
Blue Green Red
Sample Output II   
Anila Erol Bardhyl Erisa
Anila Erol Erisa Bardhyl
Anila Bardhyl Erol Erisa
Anila Bardhyl Erisa Erol
Anila Erisa Erol Bardhyl
Anila Erisa Bardhyl Erol
Erol Anila Bardhyl Erisa
Erol Anila Erisa Bardhyl
Erol Bardhyl Anila Erisa
Erol Bardhyl Erisa Anila
Erol Erisa Anila Bardhyl
Erol Erisa Bardhyl Anila
Bardhyl Anila Erol Erisa
Bardhyl Anila Erisa Erol
Bardhyl Erol Anila Erisa
Bardhyl Erol Erisa Anila
Bardhyl Erisa Anila Erol
Bardhyl Erisa Erol Anila
Erisa Anila Erol Bardhyl
Erisa Anila Bardhyl Erol
Erisa Erol Anila Bardhyl
Erisa Erol Bardhyl Anila
Erisa Bardhyl Anila Erol
Erisa Bardhyl Erol Anila


Для отправки решений необходимо выполнить вход.

www.contester.ru