Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- const int N=105;
- typedef long double ld;
- typedef long long ll;
- using namespace std;
- ll n, r[N], cx[N], cy[N];
- int toremove[N];
- ld dist(int a, int b) {
- return (ld)sqrt((ld)((cx[a] - cx[b]) * (cx[a] - cx[b]) + (cy[a] - cy[b]) * (cy[a] - cy[b])));
- }
- int main()
- {
- cin >> n;
- for(int i = 0; i < n; i++)
- cin >> r[i] >> cx[i] >> cy[i];
- for(int i = 0; i < n; i++)
- {
- for(int j = 0; j < n; j++)
- {
- if(i == j)
- continue;
- if(dist(i, j) + (ld)r[j] <= (ld)r[i])
- toremove[i] = 1;
- }
- }
- int ans = 0;
- for(int i = 0; i < n; i++)
- {
- ans += toremove[i];
- toremove[i] = 0;
- }
- cout << n - ans << "\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement