This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
ll M,N,L,a[111111];
int main(){
ios::sync_with_stdio(0);
cin>>M>>N>>L;
for(int i=0;i<M;i++)cin>>a[i];
sort(a,a+M);
int x,y,l,r,ans=0;
for(int i=0;i<N;i++){
cin>>x>>y;
l=x-L+y;
r=x+L-y;
l=lower_bound(a,a+M,l)-a;
r=upper_bound(a,a+M,r)-a;
if(l>=r)continue;
ans++;
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |