func_code_string: #include <bits/stdc++.h>   using namespace std;   const int inf = 1e9 + 9;   const int Mod = 1e9 + 7;   inline int dcmp(double x) {     if (fabs(x) <= 1e-9) return 0;     return x < 0 ? -1 : 1;   }   inline int scan() {     int x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   inline long long scan(long long x) {     int f = 1;     char ch = getchar();     x = 0;     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = x * 10 + ch -  0 ;       ch = getchar();     }     return x * f;   }   struct Point {     int x, y, id;     Point(int x = 0, int y = 0) : x(x), y(y) {}     Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }     Point operator*(const long long &a) const { return Point(x * a, y * a); }     Point operator+(const Point &a) const { return Point(x + a.x, y + a.y); }     bool operator==(const Point &a) const {       return dcmp(x - a.x) == 0 && dcmp(y - a.y) == 0;     }     bool operator<(const Point &a) const {       if (x == a.x) return y < a.y;       return x < a.x;     }     void read() { scanf( %d%d , &x, &y); }     void out() { cout << x <<     << y << endl; }   };   double Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }   double dis(Point a) { return sqrt(Dot(a, a)); }   long long Cross(Point a, Point b) { return a.x * 1LL * b.y - a.y * 1LL * b.x; }   bool chk(Point p1, Point p2, Point p3, Point p) {     return abs(Cross(p2 - p, p1 - p)) + abs(Cross(p3 - p, p2 - p)) +                abs(Cross(p1 - p, p3 - p)) ==            abs(Cross(p2 - p1, p3 - p1));   }   int n, k, ti;   int a[200005], vis[200005];   void solve() {     n = scan();     k = scan();     for (int i = 1; i <= n; i++) a[i] = scan();     memset(vis, 0, sizeof(vis));     sort(a + 1, a + 1 + n);     for (int i = 1; i <= n; i++) {       ti = i;       while (ti - 1) {         ti--;         if (vis[ti]) break;         if (a[ti] + k < a[i]) break;         if (a[ti] < a[i])           vis[ti] = 1;         else           break;       }     }     ti = 0;     for (int i = 1; i <= n; i++) {       if (!vis[i]) ti++;     }     cout << ti << endl;   }   int main() {     int t = 1;     for (int i = 1; i <= t; i++) {       solve();     }     return 0;   }   