不是哥们
怎么会内存超限呢
#include<bits/stdc++.h>
using namespace std;
int a[200005];
multimap<long long,long long> f;
int main(){
freopen("a.in","r",stdin);
ios::sync_with_stdio(false);
cin.tie(0);
int n,c;
cin>>n>>c;
for(int i=0;i<n;i++){
cin>>a[i];
}
for(int i=0;i<n;i++){
for(int k=i+1;k<n;k++){
f.insert(make_pair(a[i],a[k]));
}
}
int add=0;
for(auto it=f.begin();it!=f.end();it++){
int a=it->first,b=it->second;
if(abs(a-b)==c){
add++;
}
}
cout<<add;
}