#include<iostream>
#include<map>
using namespace std;
typedef long long ll;
ll n,c;
map<ll, ll>mp;
ll ans=0;
int a[200001];
int main()
{
cin >> n>>c;
mp.clear();
for (int i = 0; i < n; i++)
{
cin >> a[i];
mp[a[i]]++;
a[i] -= c;
}
for (int i = 0; i < n; i++)
{
ans += mp[a[i]];
}
cout << ans << endl;
return 0;
}
差
最新推荐文章于 2024-08-29 22:25:44 发布