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

402个结点就够了.

Posted by 456852456852 at 2011-08-11 12:34:28 on Problem 1087 and last updated at 2011-08-11 12:42:46
如果有用电器需要用到插座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