2011年10月13日

求第N个排列数

摘要: 设序列为N个M位数的基本数字组成的排列数(N<=M)假设序列是有序的,求第n个排列数(以0开始索引,0<=n<N!)GetNofPvoid GetNofP(char const * const in,char* out,int const size,unsigned long long N)//in必须为递增的序列,size为in的大小//out为结果序列,out的大小必须大于size//0<=N<size!{ strcpy(out,in); vector<unsigned long long > info(size); int pos = size 阅读全文

posted @ 2011-10-13 17:24 SammyLan 阅读(355) 评论(0) 推荐(0) 编辑

导航