90分,求调
查看原帖
90分,求调
910323
aeo_lian楼主2024/1/7 11:33
#include <bits/stdc++.h>  
using namespace std;  

int a[10001][2], b[10001][2], x, y, i, n, m;  

int main()  
{  
	cin >> i;   
	for (int j = 1; j <= i; j++) 
	{
		cin >> a[j][0] >> a[j][1] >> n >> m; 
		b[j][0] = a[j][0] + n;
		b[j][1] = a[j][1] + m;
	}  
	cin >> x >> y; 
	for (int j = i; j >= 1; j--)  
	{
		if (x >= a[j][0] && x <= b[j][0] && y >= a[j][1] && y <= b[j][1]) 
		{
			cout << j;  
			return 0;
		}  
	}
	cout << -1;  
	
	return 0;  
 	
}  
2024/1/7 11:33
加载中...