202009-2 风险人群筛查
作者:互联网
202009-2 风险人群筛查
本题链接:202009-2 风险人群筛查
本博客给出本题截图:
C++
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int n, k, t, x1, y1, x2, y2;
int main()
{
cin >> n >> k >> t >> x1 >> y1 >> x2 >> y2;
int res1 = 0, res2 = 0;
while (n -- )
{
bool r1 = false, r2 = false;
int s = 0;
for (int i = 0; i < t; i ++ )
{
int x, y;
cin >> x >> y;
if (x >= x1 && x <= x2 && y >= y1 && y <= y2)
{
s ++ ;
r1 = true;
if (s >= k) r2 = true;
}
else s = 0;
}
if (r1) res1 ++ ;
if (r2) res2 ++ ;
}
cout << res1 << endl << res2 << endl;
return 0;
}
总结
水题,不解释
标签:include,人群,++,int,筛查,y1,x1,202009 来源: https://blog.csdn.net/qq_52156445/article/details/120260017