题目链接 codeforces 842 B
题意:
求圆环内完整的圆有多少个
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
double dis(double x, double y){ // 求原点到圆心的距离
return sqrt((x * x) + (y * y));
}
int main(){
double D, R;
int n, ans = 0;
cin >> R >> D >> n;
for(int i = 1; i <= n; i++){
double x, y, r;
cin >> x >> y >> r;
double k = dis(x, y);
if(R >= k + r && (R-D) <= (k-r)){ // 在圆环内
ans++;
}
}
cout << ans << endl;
return 0;
}