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

Method dist

code/data-structures/kd_tree.cpp:7–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5 pt() {}
6 pt(double c[K]) { rep(i,0,K) coord[i] = c[i]; }
7 double dist(const pt &other) const {
8 double sum = 0.0;
9 rep(i,0,K) sum += pow(coord[i] - other.coord[i], 2.0);
10 return sqrt(sum); } };
11 struct cmp {
12 int c;
13 cmp(int _c) : c(_c) {}

Callers 2

_nnMethod · 0.45
testFunction · 0.45

Calls 1

sqrtFunction · 0.85

Tested by 1

testFunction · 0.36