版本比较
题解 P3632 【[APIO2011]寻路】
正文
增加 5 行删除 5 行
133 行未改动全部展开13413513613713813813914014114297 行未改动24024124224324424524424524624724824921 行未改动27127227327427527527627727827930 行未改动3103113123133143143153163173186 行未改动133 行未改动全部展开 Q.push(Begin); dis[Begin] = 0; vis[Begin] = 1; while (!Q.empty()) { int k = Q.front(); int k = Q.front(); vis[k] = 0; Q.pop(); for (int i = 0; i < v[k].size(); i++) { int to = v[k][i].to; LL w = v[k][i].w;97 行未改动
void Build(){ cnt = tot = 0; ++Cnt; Begin = New(sx,sy,-1); End = New(tx,ty,-1); Begin = New(sx,sy,-1); End = New(tx,ty,-1); for (int i = 1; i <= n; i++) { E[++tot] = Event(py1[i],px1[i],1); E[++tot] = Event(py2[i] + 1,px1[i],2); E[++tot] = Event(py1[i],px1[i],5);21 行未改动 int po = Lower(1,1,cx,E[i].pos + 1,cx); if (po < inf) New(po,E[i].key,1); } }
tot = 0; for (int i = 1; i <= n; i++) { E[++tot] = Event(px1[i],py1[i],1); E[++tot] = Event(px2[i] + 1,py1[i],2);30 行未改动{ #ifdef DMC freopen("DMC.txt","r",stdin); #endif
cin >> Ti; while (Ti--) { Read(); Work();6 行未改动