正文
增加 5 行删除 5 行
64 行未改动65666768697071727312 行未改动86878889909192939445 行未改动14014114214314414514614714851 行未改动2002012022032042052062072085 行未改动2142152162172182192202212224 行未改动64 行未改动while (l <= sizx && r <= sizy && tot < w){if (dis[x][l] > dis[y][r] + 1){if (vis[dp[x][l]]){l++;continue;}12 行未改动dis[0][++tot] = dis[y][r] + 1;dp[0][tot] = dp[y][r++];}}if (tot == w){clone(x,tot);return;}45 行未改动{tag[i] = 0;continue;}for (int j=0;j<(int)g[i].size();j++)d[g[i][j]]--;}p.push(s);while (!p.empty())51 行未改动while (q--){ans = -1;scanf("%d%d",&s,&y);for (int i=1;i<=y;i++){scanf("%d",&c[i]);vis[c[i]] = 1;}5 行未改动{ans = dis[s][i];break;}}}else bfs();for (int i=1;i<=y;i++) vis[c[i]] = 0;printf("%d\n",ans);4 行未改动64 行未改动65666768697071727312 行未改动86878889909192939445 行未改动14014114214314414514614714851 行未改动2002012022032042052062072085 行未改动2142152162172182192202212224 行未改动64 行未改动while (l <= sizx && r <= sizy && tot < w){if (dis[x][l] > dis[y][r] + 1){if (vis[dp[x][l]]){l++;continue;}12 行未改动dis[0][++tot] = dis[y][r] + 1;dp[0][tot] = dp[y][r++];}}if (tot == w){clone(x,tot);return;}45 行未改动{tag[i] = 0;continue;}for (int j=0;j<(int)g[i].size();j++)d[g[i][j]]--;}p.push(s);while (!p.empty())51 行未改动while (q--){ans = -1;scanf("%d%d",&s,&y);for (int i=1;i<=y;i++){scanf("%d",&c[i]);vis[c[i]] = 1;}5 行未改动{ans = dis[s][i];break;}}}else bfs();for (int i=1;i<=y;i++) vis[c[i]] = 0;printf("%d\n",ans);4 行未改动