| 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) {} |
| 14 | bool operator ()(const pt &a, const pt &b) const { |
| 15 | for (int i = 0, cc; i <= K; i++) { |
| 16 | cc = i == 0 ? c : i - 1; |
| 17 | if (abs(a.coord[cc] - b.coord[cc]) > EPS) |
| 18 | return a.coord[cc] < b.coord[cc]; |
| 19 | } |
| 20 | return false; } }; |
| 21 | struct bb { |
| 22 | pt from, to; |
| 23 | bb(pt _from, pt _to) : from(_from), to(_to) {} |