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 |
WA的问题这题记录路径一定要用数组pre[][]记录么? 我直接递归寻找路径,怎么WA呢? 路径上的点一定满足:dist[l][i] + dist[i][r] == dist[l][r] 递归函数如下,请看看问题出现在哪里 void create_end(int l, int r, int k) { int i; if(dist[l][r] == g[l][r]) { end[len++] = r; return ; } FOR(i, 1, k) if(i != l && i != r && dist[l][i] + dist[i][r] == dist[l][r]) { create_end(l, i, k); create_end(i, r, k); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator