第1个回答  2012-07-16
在datastruct类,老师给partychen一个简单的排序问题:
一个置换p[0],P [1],...,P [N-1]是一个序列包含每个数字从0到n-1一次。置换p数组的长度,n是一个长度为n,其中B[P[I]=[I](基于0的索引)数组B的结果。
鉴于一个数组,一个找到一个置换,其中有排序的元素的影响,即在非降序,其中每个元素是大于或等于前一个命令。如果有几个合适的排列输出字典最小的一个。
置换p[0],P[1],...,P[N-1]被认为是比排列q小字典[0],Q[1],...,Q[N-1],如果有一个索引i,使得P [我]<Q[I]和方程P [J]= Q[J]对于所有的j<i持有。

输入
输入的第一行给出的案件数,N(1≤N≤100)。按照N测试个案。
在每个测试案例中,有两行,第一行是一个基于整数米(1 <=M <= 10000),表示数组A的号码,并在第二行有Mintergers。
产量
输出discrible以上的置换p。

以上内容来自google翻译本回答被网友采纳
第2个回答  2012-07-16
Description(描述)

In datastruct class,the teacher gives partychen a simple sort question:
在数据结构课上,老师给partychen出了一个简单的排序问题
A permutation p[0], p[1], ..., p[n-1] is a sequence containing each number from 0 to n-1 exactly once. The result of applying permutation p to an array A of length n is an array B of length n, where B[p[i]] = A[i] (0-based indices).
p[0],p[1],...,p[n-1]是一个序列,包含0-n1有且仅一次。将这个序列附加到长为n的数组A得到的结果是一个长为n的数组B,且B[p[i]] = A[i] (数组序号从0开始)
Given an array A, find a permutation which has the effect of sorting the elements of A in non-descending order, i.e., an order where each element is greater than or equal to the previous one. If there are several suitable permutations output the lexicographically smallest one.
给定一个数组A,寻找一个排列使得这个序列具有将A中元素按非递减序列排列的效果,也就是说,一个序列使得每个元素大于或等于之前一个元素。如果有多个合适的排列,输出字典最小的那个。
The permutation p[0], p[1], ..., p[n-1] is considered lexicographically smaller than the permutation q[0], q[1], ..., q[n-1] if there is an index i such that p[i] < q[i] and the equation p[j] = q[j] holds for all j < i.
排列p[0], p[1], ..., p[n-1] 被认为小于排列q[0], q[1], ..., q[n-1]如果存在一个索引i使得p[i] < q[i],在对于所有的j<i都有p[j] = q[j]的前提下

以上内容来自本人手工翻译本回答被提问者采纳
第3个回答  2012-07-16
下个有道词典,翻译下不就知道了,要学会使用工具
第4个回答  2012-07-16
.......yun
第5个回答  2012-07-16
无语
相似回答