1 solutions

  • 0
    @ 2025-3-3 16:28:36

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int h[10001][5];
    int main(){
       int n,r,x,y,c=-1;
       cin>>n;
       for(r=1;r<=n;r++){
       		cin>>h[r][1]>>h[r][2]>>h[r][3]>>h[r][4];
    		h[r][3] += h[r][1];
    		h[r][4] += h[r][2]; 
       }
       cin>>x>>y;
       for(r=n;r>=1;r--){
       		if(x>=h[r][1] && x<=h[r][3] && y>=h[r][2] && y<=h[r][4]) {
       			cout<<r;
    			return 0;	
    		}
       }
      	cout<<c; 
        return 0;
    }
    
    
    • 1

    Information

    ID
    10241
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By