Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

不是6层循环暴搜吗?

Posted by yuanyirui at 2007-03-28 01:49:20 on Problem 2245
        for(i=0;i<k;i++) scanf("%d",&a[i]);
        for(a1=0;a1<k-5;a1++)
            for(a2=a1+1;a2<k-4;a2++)
                for(a3=a2+1;a3<k-3;a3++)
                    for(a4=a3+1;a4<k-2;a4++)
                        for(a5=a4+1;a5<k-1;a5++)
                            for(a6=a5+1;a6<k;a6++)
                                printf("%d %d %d %d %d %d\n",a[a1],a[a2],a[a3],a[a4],a[a5],a[a6]);

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator