# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
276788 |
2020-08-20T16:43:33 Z |
sean9892 |
사냥꾼 (KOI13_hunter) |
C++14 |
|
70 ms |
4344 KB |
#include<bits/stdc++.h>
using namespace std;
int main(void){
ios::sync_with_stdio(0);cin.tie(0);
int m,n,l;
cin>>m>>n>>l;
vector<int> h(m),x(n),y(n);//hunter, animal
for(int i=0;i<m;i++){
cin>>h[i];
}
for(int i=0;i<n;i++){
cin>>x[i]>>y[i];
}
sort(h.begin(),h.end());
int cnt=0;
for(int i=0;i<n;i++){
if(l<y[i])continue;
int lb=lower_bound(h.begin(),h.end(),x[i])-h.begin();
int ub=lower_bound(h.begin(),h.end(),x[i])-h.begin();
if(lb!=ub){
cnt++;
}
else{
for(int j=ub-3;j<ub+4;j++){
if(j<0||j>=m)continue;
if(abs(x[i]-h[j])+y[i]<=l){
cnt++;
break;
}
}
}
}
cout<<cnt;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
1 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
0 ms |
384 KB |
Output is correct |
8 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
0 ms |
392 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Correct |
1 ms |
384 KB |
Output is correct |
8 |
Correct |
1 ms |
384 KB |
Output is correct |
9 |
Correct |
1 ms |
384 KB |
Output is correct |
10 |
Correct |
1 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
416 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
2 ms |
384 KB |
Output is correct |
7 |
Correct |
2 ms |
384 KB |
Output is correct |
8 |
Correct |
2 ms |
384 KB |
Output is correct |
9 |
Correct |
2 ms |
384 KB |
Output is correct |
10 |
Correct |
2 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
34 ms |
2552 KB |
Output is correct |
2 |
Correct |
47 ms |
3064 KB |
Output is correct |
3 |
Correct |
40 ms |
3448 KB |
Output is correct |
4 |
Correct |
55 ms |
3072 KB |
Output is correct |
5 |
Correct |
42 ms |
4096 KB |
Output is correct |
6 |
Correct |
70 ms |
4088 KB |
Output is correct |
7 |
Correct |
57 ms |
4344 KB |
Output is correct |
8 |
Correct |
58 ms |
3704 KB |
Output is correct |
9 |
Correct |
64 ms |
4344 KB |
Output is correct |
10 |
Correct |
64 ms |
4248 KB |
Output is correct |