Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n, m;
- int main(){
- scanf("%d%d", &n, &m);
- double x[n+1], y[n+1];
- for(int i=1;i<=n;i++){
- scanf("%lf%lf", &x[i], &y[i]);
- }
- int ans = 0;
- for(int i=1;i<=m;i++){
- double X, Y, r;
- scanf("%lf%lf%lf", &X, &Y, &r);
- int cnt = 0;
- double L, R, U, D;
- L = (double) X - r;
- R = (double) X + r;
- U = (double) Y + r;
- D = (double) Y - r;
- for(int j=1;j<=n;j++){
- double dis;
- dis = (double)sqrt((double)(X - x[j])*(X - x[j]) + (double)(Y - y[j])*(Y - y[j]));
- if(dis < r and L < x[j] and x[j] < R and y[j] < U and y[j] > D) cnt ++;
- }
- if(cnt < n and cnt > 0) ans ++;
- }
- printf("%d", ans);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement