正文
增加 5 行删除 5 行
58 行未改动5960616263646566676869707172737454 行未改动12913013113213313413513613713813914014114214314416 行未改动16116216316416516616716816915 行未改动58 行未改动using std::bitset;using std::stack;bool operator <(const vector<int>&a, const vector<int>&b) {unsigned sx = a.size(), sy = b.size(), siz = min(sx, sy);for (unsigned i = 0; i < siz; ++i)if (a[i] > b[i]) return 0;else if (a[i] < b[i]) return 1;return sx < sy;}bool operator >(const vector<int>&a, const vector<int>&b) {unsigned sx = a.size(), sy = b.size(), siz = min(sx, sy);for (unsigned i = 0; i < siz; ++i)if (a[i] > b[i]) return 1;else if (a[i] < b[i]) return 0;return sx > sy;}//保证字典序的途径54 行未改动if (!vis[to] || dis[to] == inf) return 0;// 判断从点 start 开始能不能到达终点 tofor (onTheSP[to] = 1; !s.empty(); s.pop()) //找到全部的在当前最短路上的点for (int u = s.top(), i = head[u], w = dis[u], v, d; i; i = edge[i].next)if (!isErased[i] && onTheSP[v = edge[i].to] && dis[v] == (d = w + edge[i].dis)) {onTheSP[u] = 1;//通过判断能否松弛下一条边判断是否在最短路break;}for (int u = start, w; u != to; ) {path.emplace_back(u), w = dis[u];for (int i = head[u], v = (u = n + 1, 0); i; i = edge[i].next)if (!isErased[i] && onTheSP[v = edge[i].to] && dis[v] == w + edge[i].dis)u = min(u, v);//保证字典序}path.emplace_back(to);len = lastlen + dis[to];//合并之前的路径前缀return 1;16 行未改动u = U.path[p];v = U.path[p + 1];for (e = head[u]; e; e = edge[e].next) if (edge[e].to == v) break;//取出边 eV.Init(u);//使路径以点 u 为起点V.erasedEdges = U.erasedEdges;//加入已经不能走的边V.erasedEdges.emplace_back(e);//去除边 eV.lastlen = w;//记录已走路径前缀w += edge[e].dis;//之后路径前缀长增加了 edge[e].disfor (int i = 0; i < p; ++i) V.path.emplace_back(U.path[i]);//加入已走的点15 行未改动58 行未改动5960616263646566676869707172737454 行未改动12913013113213313413513613713813914014114214314416 行未改动16116216316416516616716816915 行未改动58 行未改动using std::bitset;using std::stack;bool operator <(const vector<int>&a, const vector<int>&b) {unsigned sx = a.size(), sy = b.size(), siz = min(sx, sy);for (unsigned i = 0; i < siz; ++i)if (a[i] > b[i]) return 0;else if (a[i] < b[i]) return 1;return sx < sy;}bool operator >(const vector<int>&a, const vector<int>&b) {unsigned sx = a.size(), sy = b.size(), siz = min(sx, sy);for (unsigned i = 0; i < siz; ++i)if (a[i] > b[i]) return 1;else if (a[i] < b[i]) return 0;return sx > sy;}//保证字典序的途径54 行未改动if (!vis[to] || dis[to] == inf) return 0;// 判断从点 start 开始能不能到达终点 tofor (onTheSP[to] = 1; !s.empty(); s.pop()) //找到全部的在当前最短路上的点for (int u = s.top(), i = head[u], w = dis[u], v, d; i; i = edge[i].next)if (!isErased[i] && onTheSP[v = edge[i].to] && dis[v] == (d = w + edge[i].dis)) {onTheSP[u] = 1;//通过判断能否松弛下一条边判断是否在最短路break;}for (int u = start, w; u != to; ) {path.emplace_back(u), w = dis[u];for (int i = head[u], v = (u = n + 1, 0); i; i = edge[i].next)if (!isErased[i] && onTheSP[v = edge[i].to] && dis[v] == w + edge[i].dis)u = min(u, v);//保证字典序}path.emplace_back(to);len = lastlen + dis[to];//合并之前的路径前缀return 1;16 行未改动u = U.path[p];v = U.path[p + 1];for (e = head[u]; e; e = edge[e].next) if (edge[e].to == v) break;//取出边 eV.Init(u);//使路径以点 u 为起点V.erasedEdges = U.erasedEdges;//加入已经不能走的边V.erasedEdges.emplace_back(e);//去除边 eV.lastlen = w;//记录已走路径前缀w += edge[e].dis;//之后路径前缀长增加了 edge[e].disfor (int i = 0; i < p; ++i) V.path.emplace_back(U.path[i]);//加入已走的点15 行未改动