Description: Description n elements (1,2 ,..., n) there are n! Different order. This n! Were arranged according to lexicographic order, and numbered 0,1, ..., n!-1. With the numbering of each sequence value for the dictionary. For example, when n = 3 when six different lexicographic order of value are as follows: Missions: given n and n elements (1,2 ,..., n) an array to calculate the lexicographic order of value , as well as lexicographic order with the next. Input Line 1 is the number of elements n (n <15). The next one line is n elements (1,2 ,..., n) of an array. Output the first line is the lexicographic value, line 2 is arranged according to lexicographic order of the next. Sample Input 82 6 4 5 8 1 7 3Sample Output 82272 6 4 5 8 3 1 7
To Search:
- [pailiezuhe] - Realize the lexicographic order of the o
- [dictionary] - Given the alphabet A by the 26 lowercase
- [testusb] - For inquiries PC, whether there is the U
- [1] - C one month the results of learning do a
- [Lexicographic_order] - acm algorithm design: the problem with t
File list (Check if you may need any files):
zidianxu.cpp