版本比较
根号分治 - P14372 [JOISC 2018] 比太郎的聚会 / Bitaro's Party
正文
增加 5 行删除 5 行
64 行未改动6566676869697071727312 行未改动8687888990909192939445 行未改动14014114214314414414514614714851 行未改动2002012022032042042052062072085 行未改动2142152162172182182192202212224 行未改动64 行未改动 while (l <= sizx && r <= sizy && tot < w) { if (dis[x][l] > dis[y][r] + 1) { if (vis[dp[x][l]]) if (vis[dp[x][l]]) { l++; continue; }12 行未改动 dis[0][++tot] = dis[y][r] + 1; dp[0][tot] = dp[y][r++]; } } if (tot == w) if (tot == w) { clone(x,tot); return; }45 行未改动 { tag[i] = 0; continue; } for (int j=0;j<(int)g[i].size();j++) 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++) 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 行未改动