#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <iterator>
#define ll long long
using namespace std;
ll n, k, t, x_1, x_2, y_1, y_2, pass_num, stay_num;
struct position
{
ll x, y;
};
bool pass(ll x, ll y)
{
return ((x_1 <= x && x <= x_2) && (y_1 <= y && y <= y_2));
}
int main() {
cin >> n >> k >> t >> x_1 >> y_1 >> x_2 >> y_2;
for (size_t i = 0; i < n; i++)
{
bool have_passed = 0, have_stayed = 0;
ll pass_time = 0;
vector<position>vec(t);
for (size_t j = 0; j < t; j++)
{
cin >> vec[i].x >> vec[i].y;
if (pass(vec[i].x, vec[i].y))
{
have_passed = 1;
pass_time++;
if (pass_time >= k) have_stayed = 1;
}
else pass_time = 0;
}
if (have_passed) pass_num++;
if (have_stayed) stay_num++;
}
cout << pass_num << endl << stay_num;
return 0;
}
【算法练习】CSP--202009-2--风险人群筛查
最新推荐文章于 2024-10-16 00:00:43 发布