You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
intmain() {
cin >> n >> m;
for (int i = 1; i <= n; i++) d[i][i] = 1;
for (int i = 1; i <= m; i++) {
int x, y;
scanf("%d%d", &x, &y);
d[x][y] = d[y][x] = 1;
}
for (int k = 1; k <= n; k++)
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
d[i][j] |= d[i][k] & d[k][j];
}
for (int i = 1; i <= n; i++) d[i][i] = 1; 这一行应去掉,且原书P360所述有误:
for (int i = 1; i <= n; i++) d[i][i] = 1;
这一行应去掉,且原书P360所述有误:可以很轻松举出反例,如$d[i][i]$ 初始化为 $1$ 。
<
「小于」关系显然具有传递性,即a<b,b<c
可以推出a<c
,但显然a<a
不成立,因此 不能将The text was updated successfully, but these errors were encountered: