MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / candidates

Method candidates

code/geometry/rmst.cpp:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31 bst = tmp[k]; } }
32 rep(i,l,r+1) arr[i] = tmp[i]; }
33 vector<pair<ll,ii> > candidates() {
34 vector<pair<ll, ii> > es;
35 rep(p,0,2) {
36 rep(q,0,2) {
37 sort(arr, arr+n);
38 rep(i,0,n) best[i].i = -1;
39 rec(0,n-1);
40 rep(i,0,n) {
41 if(best[arr[i].i].i != -1)
42 es.push_back({arr[i].dist(best[arr[i].i]),
43 {arr[i].i, best[arr[i].i].i}});
44 swap(arr[i].x, arr[i].y);
45 arr[i].x *= -1, arr[i].y *= -1; } }
46 rep(i,0,n) arr[i].x *= -1; }
47 return es; } };
48// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 3

recFunction · 0.85
push_backMethod · 0.80
distMethod · 0.45

Tested by

no test coverage detected