风险人群筛查 ccf202009-2
ccf刷题记录
ccf202009-2
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, k, t, xl, yd, xr, yu;
int ans1 = 0, ans2 = 0;
bool jdg(int x, int y) {
return x>=xl && x<=xr && y>=yd && y<=yu;
}
int main() {
cin >> n >> k >> t >> xl >> yd >> xr >> yu;
int x, y;
for (int i = 0; i < n; i++) {
int anst1 = 0;
int tmp = 0, anst2 = 0;
for (int j = 0; j < t; j++) {
cin >> x >> y;
if (jdg(x, y)) {
anst1 = 1;
tmp++;
anst2 = max(tmp, anst2);
}else {
tmp = 0;
}
}
if (anst1) ans1++;
if (anst2 >= k) ans2++;
}
cout << ans1 << endl << ans2 << endl;
return 0;
}