| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:16个数中取4个数的排列有什么好的算法吗? 最好的复杂度大概是多少?In Reply To:16个数中去4个数的排列有什么好的算法吗? 最好的复杂度大概是多少? Posted by:stu_butter at 2007-01-28 20:07:11 >
是取4个数
> 我的做法是
>
> do
> {
> j=0;
> for(i=0;i<16;i++)
> if(sign[i])
> temp[j++]=i;
> do
> {
>
> }while(next_permutation(temp,temp+4));//再求全排列
>
> }while(next_permutation(sign,sign+16));//求组合
>
> 但是超时ING....
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator