| ||||||||||
| 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 (int s = 0; s < V; s++)
for (int t = 0; t < V; t++)
{
if (s == t) continue;
for (int i = 0; i < V; i++)
{
if (dist[s][i] + dist[i][t] < dist[s][t])
dist[s][t] = dist[s][i] + dist[i][t];
}
}
for (int i = 0; i < V; i++)
for (int s = 0; s < V; s++)
for (int t = 0; t < V; t++)
if (s != t)
if (dist[s][t] > dist[s][i] + dist[i][t])
dist[s][t] = dist[s][i] + dist[i][t];
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator