90分蒟蒻求助,在线等,挺急的
查看原帖
90分蒟蒻求助,在线等,挺急的
1059536
yylz1031楼主2024/8/15 18:37
#include <bits/stdc++.h>

using namespace std ;

int n ;
int a [ 100005 ], b [ 100005 ], c [ 100005 ], d [ 100005 ] ;
int x, y ;
int ans = -1 ;

int main () {

	cin >> n ;

	for ( int i = 1 ; i <= n ; i ++ )
		cin >> a [ i ] >> b [ i ] >> c [ i ] >> d [ i ] ;

	cin >> x >> y ;

	for ( int i = 1 ; i <= n ; i ++ )
		if ( x >= a [ i ] and x <= c [ i ] and y >= b [ i ] and y <= d [ i ] )
			ans = i ;

	if ( ans != 0 ) cout << ans ;
	else cout << -1 ;

}
2024/8/15 18:37
加载中...