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 <stdio.h>
#include <algorithm>
using namespace std;
int m, n, l, shoot[100001], x[100001], y[100001], ans;
void input(void)
{
int i;
scanf("%d %d %d",&m,&n,&l);
for(i=1 ; i<=m ; i++)
scanf("%d",&shoot[i]);
sort(shoot+1,shoot+m+1);
for(i=1 ; i<=n ; i++)
scanf("%d %d",&x[i],&y[i]);
}
void process(void)
{
int i, a, b, left, right;
for(i=1 ; i<=n ; i++)
{
a=x[i]-l+y[i];
b=x[i]+l-y[i];
left=lower_bound(&shoot[1],&shoot[m]+1,a)-shoot;
right=upper_bound(&shoot[1],&shoot[m]+1,b)-shoot-1;
if(left<=right)
ans++;
}
}
void output(void)
{
printf("%d",ans);
}
int main(void)
{
input();
process();
output();
return 0;
}
# | 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... |