# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
14678 |
2015-06-03T05:48:32 Z |
Fakeable |
사냥꾼 (KOI13_hunter) |
C++ |
|
90 ms |
2256 KB |
#include<cstdio>
#include<algorithm>
#include<utility>
#define pi pair<int,int>
using namespace std;
const int max_n = 100100;
int n,d,l,x[max_n];
pi p[max_n];
inline int Abs(int x) {
return x>0?x:-x;
}
void input() {
scanf("%d %d %d",&n,&d,&l);
for(int i=0;i<n;i++) scanf("%d",&x[i]);
x[n] = 2000000001;
for(int i=0;i<d;i++) scanf("%d %d",&p[i].first, &p[i].second);
sort(x,x+n);
sort(p,p+d);
return;
}
int find(int front,int rear,int crit) {
if(front == rear) return front;
int mid = (front + rear + 1) / 2;
if(x[mid] >= crit) return find(front,mid-1,crit);
return find(mid,rear,crit);
}
void solve() {
int print = 0;
for(int i=0;i<d;i++) {
int close = find(0,n-1,p[i].first);
if(l-p[i].second >= Abs(p[i].first - x[close]) || l-p[i].second >= Abs(p[i].first-x[close+1])) print++;
}
printf("%d\n",print);
return;
}
int main() {
input();
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2256 KB |
Output is correct |
2 |
Correct |
0 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2256 KB |
Output is correct |
2 |
Correct |
0 ms |
2256 KB |
Output is correct |
3 |
Correct |
0 ms |
2256 KB |
Output is correct |
4 |
Correct |
0 ms |
2256 KB |
Output is correct |
5 |
Correct |
0 ms |
2256 KB |
Output is correct |
6 |
Correct |
0 ms |
2256 KB |
Output is correct |
7 |
Correct |
0 ms |
2256 KB |
Output is correct |
8 |
Correct |
0 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2256 KB |
Output is correct |
2 |
Correct |
0 ms |
2256 KB |
Output is correct |
3 |
Correct |
0 ms |
2256 KB |
Output is correct |
4 |
Correct |
0 ms |
2256 KB |
Output is correct |
5 |
Correct |
0 ms |
2256 KB |
Output is correct |
6 |
Correct |
0 ms |
2256 KB |
Output is correct |
7 |
Correct |
0 ms |
2256 KB |
Output is correct |
8 |
Correct |
0 ms |
2256 KB |
Output is correct |
9 |
Correct |
0 ms |
2256 KB |
Output is correct |
10 |
Correct |
0 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2256 KB |
Output is correct |
2 |
Correct |
0 ms |
2256 KB |
Output is correct |
3 |
Correct |
0 ms |
2256 KB |
Output is correct |
4 |
Correct |
0 ms |
2256 KB |
Output is correct |
5 |
Correct |
2 ms |
2256 KB |
Output is correct |
6 |
Correct |
0 ms |
2256 KB |
Output is correct |
7 |
Correct |
2 ms |
2256 KB |
Output is correct |
8 |
Correct |
2 ms |
2256 KB |
Output is correct |
9 |
Correct |
0 ms |
2256 KB |
Output is correct |
10 |
Correct |
0 ms |
2256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
2256 KB |
Output is correct |
2 |
Correct |
54 ms |
2256 KB |
Output is correct |
3 |
Correct |
62 ms |
2256 KB |
Output is correct |
4 |
Correct |
48 ms |
2256 KB |
Output is correct |
5 |
Correct |
77 ms |
2256 KB |
Output is correct |
6 |
Correct |
88 ms |
2256 KB |
Output is correct |
7 |
Correct |
47 ms |
2256 KB |
Output is correct |
8 |
Correct |
77 ms |
2256 KB |
Output is correct |
9 |
Correct |
77 ms |
2256 KB |
Output is correct |
10 |
Correct |
90 ms |
2256 KB |
Output is correct |