看不到题目的图。。靠题意蒙,WA了两次。。不解释- -
#include <iostream> #include <algorithm> using namespace std; int circle[3][2] = {{30, 30}, {100, 30}, {170, 30}}; int r[3] = {20, 10, 5}; int main() { int T; cin >> T; while(T--) { int n; cin >> n; int x, y; int ans = 0; for(int i = 0; i < n; i++){ cin >> x >> y; for(int j = 0; j < 3; j++) { if(((x - circle[j][0]) * (x - circle[j][0]) + (y - circle[j][1]) * (y - circle[j][1])) < r[j] * r[j]) { ans += j + 1; break; } } } cout << ans << endl; } return 0; }