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

我对您pf得一踏糊涂...

Posted by T3 at 2005-08-04 17:45:56 on Problem 2524
In Reply To:这个就对了,其他的一样 Posted by:sunmoonstar_love at 2005-08-04 17:36:30
case都弄错了
> 
> 
>     while(scanf("%d%d",&n,&m) && n+m)
>     {
>         for(i=0; i<=n; i++)
>             uset[i] = i;
>         ans = n;
>         for(i=0; i<m; i++)
>         {
>             scanf("%d%d",&a,&b);
>             if(Root(a)!=Root(b))
>             {
>                 ans--;
>                uset[uset[b]] = uset[a];
>             }    
>         }
>         printf("Case %d: %d\n",ncase,ans);   
>         ncase++;     
>     } 

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