Each point to his collection connected to a right 0 side, each set to him all points in a right to the side of C, run the shortest way on the line.
#include <bits/stdc++.h>using namespace std; #define PRT (k) cerr<< #k "=" <<k<<endltypedef long Long Ll;//const int inf = 0x3f3f3f3f;const int M = 2000100;const LL inf = 0x3f3f3f3f3f3f3f3fll;struct edge{int v; int W; int NXT; Edge () {} edge (int vv, int ww, int Nxt =-1) {v = vv, w = ww, NXT = NXT;}} E[m << 2];int head[m], mm;void Initedge () {mm = 0; memset (head,-1, sizeof head);} void Adde (int u, int v, int w) {swap (U, v); E[MM] = Edge (V, W, Head[u]); Head[u] = mm + +;} Vector<int> g[m];int N, M; ll d1[M], d2[m];struct heap{LL D; int u; Heap () {} heap (LL dd, int uu) {d = dd, u = UU;} BOOL operator < (const heap& RHS) Const {return d > rhs.d; }};bool done[m];void dij (int src, LL d[]) {priority_queue
HDU 5521 Meeting