Lexicographic_order

所属分类:处理器开发
开发工具:Visual C++
文件大小:219KB
下载次数:31
上传日期:2009-06-12 17:02:17
上 传 者zboox
说明:  acm算法设计:排列的字典序问题 描述: n个元素{1,2,..., n }有n!个不同的排列。将这n!个排列按字典序排列,并编号为0,1,…,n!-1。每个排列的编号为其字典序值。例如,当n=3时,6 个不同排列的字典序值如下: 字典序值:0 1 2 3 4 5 排列:123 132 213 231 312 321 任务:给定n 以及n 个元素{1,2,..., n }的一个排列,计算出这个排列的字典序值,以及按字典序排列的下一个排列。 输入: 第1 行是元素个数n(n < 15)。接下来的1 行是n个元素{1,2,..., n }的一个排列。 输出: 第一行是字典序值,第2行是按字典序排列的下一个排列。 例输入: 8 2 6 4 5 8 1 7 3 例输出: 8227 2 6 4 5 8 3 1 7
(acm algorithm design: the problem with the dictionary sequence 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 number of each sequence value for the dictionary. For example, when n = 3, the six different sequence with the value of the dictionary is as follows: Lexicographic values: 0 1 2 3 4 5 Order: 123 132 213 231 312 321 Tasks: to set n and n elements (1,2 ,..., n) an arranged order to calculate the value of the dictionary sequence and arranged according to lexicographic order of the next. Input: Line 1 is the number of elements n (n <15). Line 1 is the next n elements (1,2 ,..., n) an order. Output: The first line is the value of the dictionary sequence, line 2 is arranged according to lexicographic order of the next. Cases of type: 8 2 6 4 5 8 1 7 3 Cases the output: 8227 2 6 4 5 8 3 1 7)

文件列表:
排列的字典序问题\Debug\StdAfx.obj (1878, 2009-04-30)
排列的字典序问题\Debug\vc60.idb (41984, 2009-04-30)
排列的字典序问题\Debug\vc60.pdb (69632, 2009-04-30)
排列的字典序问题\Debug\排列的字典序问题.exe (213068, 2009-04-30)
排列的字典序问题\Debug\排列的字典序问题.ilk (248316, 2009-04-30)
排列的字典序问题\Debug\排列的字典序问题.obj (7976, 2009-04-30)
排列的字典序问题\Debug\排列的字典序问题.pch (187132, 2009-04-30)
排列的字典序问题\Debug\排列的字典序问题.pdb (525312, 2009-04-30)
排列的字典序问题\StdAfx.cpp (303, 2009-04-30)
排列的字典序问题\StdAfx.h (667, 2009-04-30)
排列的字典序问题\排列的字典序问题.cpp (915, 2009-04-30)
排列的字典序问题\排列的字典序问题.dsp (4658, 2009-04-30)
排列的字典序问题\排列的字典序问题.dsw (557, 2009-04-30)
排列的字典序问题\排列的字典序问题.ncb (41984, 2009-04-30)
排列的字典序问题\排列的字典序问题.opt (48640, 2009-04-30)
排列的字典序问题\排列的字典序问题.plg (1391, 2009-04-30)
排列的字典序问题\Debug (0, 2009-04-30)
排列的字典序问题 (0, 2009-04-30)

======================================================================== CONSOLE APPLICATION : 排列的字典序问题 ======================================================================== AppWizard has created this 排列的字典序问题 application for you. This file contains a summary of what you will find in each of the files that make up your 排列的字典序问题 application. 排列的字典序问题.dsp This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally. 排列的字典序问题.cpp This is the main application source file. ///////////////////////////////////////////////////////////////////////////// Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named 排列的字典序问题.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: AppWizard uses "TODO:" to indicate parts of the source code you should add to or customize. /////////////////////////////////////////////////////////////////////////////

近期下载者

相关文件


收藏者