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

要枚举,难道是因为会存在比酋长更高的等级?

Posted by windthenrain at 2015-03-02 14:34:02 on Problem 1062
 for( i = 1 ; i <= n ; i++)
            for (j = 1 ; j <= n ; j++)
                map[i][j] = infi ;
        for(i = 1 ; i <= n ; i++)
        {
            scanf ("%d%d%d", &p[i] , &rank[i] , &x) ;
            {
                while (x--)
                {
                    scanf ("%d%d" , &a , &b) ;
                    map[i][a] = b ;
                }
            }
        }
        int solv = infi ;
        for (i = rank[1] - m ; i <= rank[1] ; i++)
        {
            dijkstra (i , i + m) ;
            for (j = 1 ; j <= n ; j++)
                solv = min (solv , p[j] + d[j]);
        }
        printf ("%d\n" , solv) ;

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