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<cstdio>
#include<algorithm>
int a[100000];
std::pair<int,int> b[100000];
int main()
{
int i,j,n,m,l;
scanf("%d%d%d",&n,&m,&l);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(j=0;j<m;j++)scanf("%d%d",&b[j].first,&b[j].second);
std::sort(a,a+n);
i=0;
for(j=0;j<m;j++)if(std::lower_bound(a,a+n,b[j].first+b[j].second-l)<std::upper_bound(a,a+n,b[j].first-b[j].second+l))i++;
printf("%d",i);
}
# | 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... |