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

Re:402个结点就够了.

Posted by NEU_20113292 at 2013-03-14 20:29:43 on Problem 1087
In Reply To:402个结点就够了. Posted by:456852456852 at 2011-08-11 12:34:28
> 如果有用电器需要用到插座A, 那么插座A连一条容量为1的边到汇点就好了, 没必要把所有用电器都当成新的结点哦.
> 
> 1. 读插座:
> scanf("%d",&n);
> for(i=1;i<=n;++i){ scanf("%s",tmp); ++m[S][getN(tmp)]; }
> 
> 2. 读用电器:
> scanf("%d",&M);
> for(i=1;i<=M;++i){ scanf("%*s %s",tmp); ++m[getN(tmp)][T]; }
> 
> 3. 读适配器:
> scanf("%d",&n);
> for(i=1;i<=n;++i){ scanf("%s %s",&tmp,&tmp1); m[getN(tmp1)][getN(tmp)]=INF; }

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