# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
4944 |
2014-01-22T18:51:38 Z |
ansol4328 |
사냥꾼 (KOI13_hunter) |
C++ |
|
36 ms |
2264 KB |
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
struct xy
{
int x, y;
};
int cmp(const xy &aa, const xy &bb)
{
return aa.x<bb.x || (aa.x==bb.x && aa.y<bb.y);
}
xy a[100002];
int n, m, l, g[100002];
int cnt;
int input()
{
int i;
scanf("%d %d %d",&m,&n,&l);
for(i=1 ; i<=m ; i++) scanf("%d",&g[i]);
for(i=1 ; i<=n ; i++) scanf("%d %d",&a[i].x,&a[i].y);
std::sort(g+1,g+1+m);
std::sort(a+1,a+1+n,cmp);
return 0;
}
int process()
{
int i=1, j=1, d;
while(j<=n)
{
if(g[i]+(g[i+1]-g[i])/2+(g[i+1]-g[i])%2<=a[j].x && i!=m) i++;
d=abs(a[j].x-g[i])+a[j].y;
if(d<=l) cnt++;
j++;
}
return 0;
}
int output()
{
printf("%d",cnt);
return 0;
}
int main()
{
input();
process();
output();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2264 KB |
Output is correct |
2 |
Correct |
0 ms |
2264 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2264 KB |
Output is correct |
2 |
Incorrect |
0 ms |
2264 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
2264 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |