#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2260 KB |
Output is correct |
2 |
Correct |
0 ms |
2260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2260 KB |
Output is correct |
2 |
Correct |
0 ms |
2260 KB |
Output is correct |
3 |
Correct |
0 ms |
2260 KB |
Output is correct |
4 |
Correct |
0 ms |
2260 KB |
Output is correct |
5 |
Correct |
0 ms |
2260 KB |
Output is correct |
6 |
Correct |
0 ms |
2260 KB |
Output is correct |
7 |
Correct |
0 ms |
2260 KB |
Output is correct |
8 |
Correct |
0 ms |
2260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2260 KB |
Output is correct |
2 |
Correct |
0 ms |
2260 KB |
Output is correct |
3 |
Correct |
0 ms |
2260 KB |
Output is correct |
4 |
Correct |
0 ms |
2260 KB |
Output is correct |
5 |
Correct |
0 ms |
2260 KB |
Output is correct |
6 |
Correct |
0 ms |
2260 KB |
Output is correct |
7 |
Correct |
0 ms |
2260 KB |
Output is correct |
8 |
Correct |
0 ms |
2260 KB |
Output is correct |
9 |
Correct |
0 ms |
2260 KB |
Output is correct |
10 |
Correct |
0 ms |
2260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
2260 KB |
Output is correct |
2 |
Correct |
0 ms |
2260 KB |
Output is correct |
3 |
Correct |
0 ms |
2260 KB |
Output is correct |
4 |
Correct |
0 ms |
2260 KB |
Output is correct |
5 |
Correct |
0 ms |
2260 KB |
Output is correct |
6 |
Correct |
0 ms |
2260 KB |
Output is correct |
7 |
Correct |
0 ms |
2260 KB |
Output is correct |
8 |
Correct |
0 ms |
2260 KB |
Output is correct |
9 |
Correct |
0 ms |
2260 KB |
Output is correct |
10 |
Correct |
0 ms |
2260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
44 ms |
2260 KB |
Output is correct |
2 |
Correct |
48 ms |
2260 KB |
Output is correct |
3 |
Correct |
60 ms |
2260 KB |
Output is correct |
4 |
Correct |
56 ms |
2260 KB |
Output is correct |
5 |
Correct |
72 ms |
2260 KB |
Output is correct |
6 |
Correct |
88 ms |
2260 KB |
Output is correct |
7 |
Correct |
76 ms |
2260 KB |
Output is correct |
8 |
Correct |
60 ms |
2260 KB |
Output is correct |
9 |
Correct |
76 ms |
2260 KB |
Output is correct |
10 |
Correct |
72 ms |
2260 KB |
Output is correct |