23 人解决,56 人已尝试。
40 份提交通过,共有 231 份提交。
6.3 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
Given a word, write a program to generate all its permutations in lexicographic order.
The input will consist of several words. The first line contains the number of words. It is followed by that many words, each appearing in single line. The words will have both uppercase and lowercase letters in them, and they are to be considered different.
For each given word in the input, print its all possible permutations, each on a different line. The different permutations should be printed in lexicographic order. An uppercase letter goes before the corresponding lowercase letter.
hint: A<a<B<b.....
2 aAb acba
Aab Aba aAb abA bAa baA aabc aacb abac abca acab acba baac baca bcaa caab caba cbaa
23 人解决,56 人已尝试。
40 份提交通过,共有 231 份提交。
6.3 EMB 奖励。