#include <bits/stdc++.h> using namespace std; using LL = long long; int main() { freopen("test.txt", "r", stdin); ios::sync_with_stdio(false); int n, t; cin >> n >>t; vector<int> v(n); for (int i = 0; i < n; ++i) { cin >> v[i]; } sort(v.begin(), v.end()); int init = t, ans = 0; for (int i = 0; i < n; ++i) { if (init <= v[i]) { init += t; } else { ++ans; } } cout << ans; return 0; }

相关推荐

牛客网
牛客企业服务