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
欢迎参加IJCAI 2020麻将智能体竞赛,大奖等你拿!Welcome to IJCAI 2020 Mahjong AI competition with amazing prizes! | 北京大学《ACM/ICPC大学生程序设计竞赛训练》暑期课面向全球招生!

我用dinic递归 做的发现了一件很诡异的事,求指教,就加了一句话,一开始tle,然后就813ms过了

Posted by windthenrain at 2015-03-06 16:37:05 on Problem 1459
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:
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