0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 20:56:37 +00:00

P2074 危险区域

R42122741
This commit is contained in:
Baoshuo Ren 2020-11-18 19:16:44 +08:00 committed by Baoshuo Ren
parent a3664210b2
commit 6fe2912c74
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

23
problem/P2074/P2074.cpp Normal file
View File

@ -0,0 +1,23 @@
#include <bits/stdc++.h>
using namespace std;
int n, m, k, t, x, y, ans, sum;
int main() {
cin >> n >> m >> k >> t;
for (int i = 0; i < k; i++) {
sum = 0;
cin >> x >> y;
for (int i = max(1, x - t); i <= min(n, x + t); i++) {
for (int j = max(1, y - t); j <= min(m, y + t); j++) {
if (sqrt((x - i) * (x - i) + (y - j) * (y - j)) <= t) {
sum++;
}
}
}
ans = max(ans, sum);
}
cout << ans << endl;
return 0;
}