• + 0 comments

    include

    using namespace std; int test(int n, long long k, vector a) { int dem = 0; unordered_sets(a.begin(), a.end()); for(int i = 0; i < n; i++) { if(a[i] > k){ long long tam = a[i] - k; if(s.find(tam) != s.end()) { dem++; } } } return dem; } int main() { int n; long long k; cin >> n >> k; vector a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } cout << test(n, k, a); return 0; }