标签:round tor ace bit family sort ext date for
///@author Sycamore ///@date 8/8/2017 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); int t; cin >> t; while (t--) { int n, k; cin >> n >> k; vector<int>v(n); for (auto &e : v)cin >> e; int cnt = 1; sort(v.begin(), v.end()); for (int i = n - 1; i>0; i--) { if (v[i] - v[i - 1] <= k)cnt++; else break; } cout << cnt << endl; } return 0; }
HDU 6095: Rikka with Competition
标签:round tor ace bit family sort ext date for
原文地址:http://www.cnblogs.com/zjnu/p/7308889.html