|
- #include <iostream>
- #include <cstdio>
- #include <cstdlib>
- #include <cmath>
- #include <cstring>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int a[12223][10]={0},n,i,d=-1,x,y;
- scanf("%d",&n);
- for(i=1;i<=n;i++)
- {
- scanf("%d",&a[i][1]);
- scanf("%d",&a[i][2]);
- scanf("%d",&a[i][3]);
- scanf("%d\n",&a[i][4]);
- }
- scanf("%d %d",&x,&y);
- for(i=1;i<=n;i++)
- {
- if(x>=a[i][1]&&x<=a[i][1]+a[i][3]&&y>=a[i][2]&&y<=a[i][2]+a[i][4])
- d=i;
- }
- printf("%d",d);
- }
复制代码 |
|