0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-24 03:48:47 +00:00

P3717 [AHOI2017初中组]cover

R42068084
This commit is contained in:
Baoshuo Ren 2020-11-17 18:59:41 +08:00 committed by Baoshuo Ren
parent 0acce68f08
commit 33d8e74a50
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

29
problem/P3717/P3717.cpp Normal file
View File

@ -0,0 +1,29 @@
#include <bits/stdc++.h>
using namespace std;
bool vis[105][105];
int main() {
int n, m, r, x, y, ans = 0;
cin >> n >> m >> r;
for (int i = 0; i < m; i++) {
cin >> x >> y;
for (int j = 1; j <= n; j++) {
for (int k = 1; k <= n; k++) {
if (sqrt((x - j) * (x - j) + (y - k) * (y - k)) <= r) {
vis[j][k] = 1;
}
}
}
}
for(int i = 1 ; i <= n ; i++) {
for(int j = 1 ; j <= n ; j++) {
if(vis[i][j]) {
ans++;
}
}
}
cout << ans << endl;
return 0;
}