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 |
我用dinic递归 做的发现了一件很诡异的事,求指教,就加了一句话,一开始tle,然后就813ms过了int find (int u , int low) { int a ; if (u == des) return low ; for (int v = 1 ; v <= n ; v++) { if (map[u][v] && dis[v] == dis[u] + 1 && (a = find (v , min (low , map[u][v])))) { map[u][v] -= a ; map[v][u] += a ; // printf ("a=%d\n" , a) ; return a ; } } dis[u] = -1 ;//就这句 return 0 ; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator