提交时间:2023-11-19 19:59:24

运行 ID: 31612

#include<iostream> using namespace std; int main() { int n; int position[10001][4]; int x, y; bool isCovered = false; cin >> n; // 读取1-n行数据 for (int i=1; i<=n; i++) { cin >> position[i][0] >> position[i][1] >> position[i][2] >> position[i][3]; // 获取右上角的坐标 position[i][2] += position[i][0]; position[i][3] += position[i][1]; } cin >> x >> y; for (int i=n; i>=1; i--) { if (position[i][0]<=x && position[i][1]<=y && position[i][2]>=x && position[i][3]>=y) { cout << i << endl; isCovered = true; break; } } if (!isCovered) { cout << -1 << endl; } return 0; }