time will tell Lv4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<cstdio>

using namespace std;
int main()
{
int n,k,t,Xl,Yd,Xr,Yu;
scanf("%d%d%d%d%d%d%d",&n,&k,&t,&Xl,&Yd,&Xr,&Yu);
int sumcross=0,sumstay=0;
while(n--)
{
int x,y;
int s=0;
int flag=0,flag1=0;
for(int i=0;i<t;i++)
{
scanf("%d%d",&x,&y);
if(x>=Xl&&x<=Xr&&y>=Yd&&y<=Yu)
s++;
else
s=0;
if(s>=k&&flag1==0)
{
sumstay++;
flag1=1;
}
if(s>0&&flag==0)
{
sumcross++;
flag=1;
}
}



}
printf("%d\n%d\n",sumcross,sumstay);
}



  • Title:
  • Author: time will tell
  • Created at : 2024-09-26 20:22:16
  • Updated at : 2024-09-26 20:22:56
  • Link: https://sbwrn.github.io/2024/09/26/202009-2风险人群/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page