/* -*- coding: utf-8 -*- * * 202.cc: No.202 1円玉投げ - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100000; const int MAX_X = 20000; const int MAX_Y = 20000; const int DX = 100; const int DY = 100; const int MAX_GX = MAX_X / DX; const int MAX_GY = MAX_Y / DY; const int RR = 20 * 20; /* typedef */ struct Pt { int x, y; Pt() {} Pt(int _x, int _y): x(_x), y(_y) {} int d2(const Pt &p) const { int dx = x - p.x, dy = y - p.y; return dx * dx + dy * dy; } }; typedef vector vpt; /* global variables */ Pt pts[MAX_N]; vpt gps[MAX_GY + 1][MAX_GX + 1]; /* subroutines */ /* main */ int main() { int n; cin >> n; int pn = 0; for (int i = 0; i < n; i++) { Pt p; cin >> p.x >> p.y; int gpx = p.x / DX, gpy = p.y / DY; bool ok = true; for (int gy = gpy - 1; ok && gy <= gpy + 1; gy++) { if (gy < 0 || gy > MAX_GY) continue; for (int gx = gpx - 1; ok && gx <= gpx + 1; gx++) { if (gx < 0 || gx > MAX_GX) continue; vpt &gv = gps[gy][gx]; for (vpt::iterator vit = gv.begin(); vit != gv.end(); vit++) if (p.d2(*vit) < RR) ok = false; } } if (ok) { pn++; gps[gpy][gpx].push_back(p); } } printf("%d\n", pn); return 0; }