Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool table[1010][1010];
- int nb, n;
- int main(){
- int x, y, r, cnt;
- scanf("%d %d", &n, &nb);
- for(int i = 0; i < n; ++i){
- scanf("%d %d", &x, &y);
- table[x][y] = true;
- }
- for(int i = 0; i < nb; ++i){
- scanf("%d %d %d", &x, &y, &r);
- cnt = 0;
- for(int j = x - r; j <= x + r; ++j){
- if(j >= 0 && j <= 1000){
- for(int k = y - r; k <= y + r; ++k){
- if(k >= 0 && k <= 1000){
- if(table[j][k]){
- table[j][k] = false;
- ++cnt;
- }
- }
- }
- }
- }
- cout << cnt << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement