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 |
要枚举,难道是因为会存在比酋长更高的等级?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator