시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
5 초 | 512 MB | 606 | 289 | 180 | 50.000% |
(String permutation) Write a recursive method to print all the permutations of a string. The user need to enter the string which consists of a set of characters.
First line of the input contains T (1 ≤ T ≤ 200), the number of test cases. For each test case, there will a string of characters, L (1 ≤ L ≤ 5).
For each test case, output a line in the format “Case # x:” where x is the case number (starting with 1), follow by the set of string permutation.
3 abc zxyw p7*
Case # 1: abc acb bac bca cab cba Case # 2: zxyw zxwy zyxw zywx zwxy zwyx xzyw xzwy xyzw xywz xwzy xwyz yzxw yzwx yxzw yxwz ywzx ywxz wzxy wzyx wxzy wxyz wyzx wyxz Case # 3: p7* p*7 7p* 7*p *p7 *7p
ICPC > Regionals > Asia Pacific > Malaysia > Malaysia National Programming Contest > Al-Khawarizmi National Programming Contest 2016 B번