#include<bits/stdc++.h>
using namespace std;
const int N = 15;
struct node
{
int id;
int x1,y1,x2,y2;
}p[N];
int n,m;
int check(int x,int y)
{
bool flag=false,idx=0;
for(int i=n;i>=1;i--)
{
int x1=p[i].x1,y1=p[i].y1;
int x2=p[i].x2,y2=p[i].y2;
if(x>=x1 && x<=x2 && y>=y1 && y<=y2)
{
flag=true;
idx=i;
return p[i].id;
}
}
if(flag)
{
node temp=p[idx];
for(int i=idx;i<n;i++)
p[i]=p[i+1];
p[n]=temp;
}
return 0;
}
int main()
{
cin >> n >> m;
for(int i=1;i<=n;i++)
{
int x1,y1,x2,y2;
cin >> x1 >> y1 >> x2 >> y2;
p[i]={i,x1,y1,x2,y2};
}
while(m--)
{
int t1,t2;
cin >> t1 >> t2;
int t=check(t1,t2);
if(!t) puts("IGNORED");
else
cout << t << endl;
}
return 0;
}
csp-窗口
最新推荐文章于 2024-03-07 20:53:42 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)