#include <iostream> #include <stdio.h> #include <string> #include <cstring> #include <map> using namespace std; struct Node { int x, y; int minx, miny; int maxx, maxy; }s[10001]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int Lenx, Leny; cin >> s[i].x >> s[i].y >> Lenx >> Leny; s[i].minx = s[i].x; s[i].maxx = s[i].x + Lenx; s[i].miny = s[i].y; s[i].maxy = s[i].y + Leny; } int x, y; cin >> x >> y; int flag = 1; for (int i = n - 1; i >= 0; i--) { if (x >= s[i].minx&&x <= s[i].maxx&&y >= s[i].miny&&y <= s[i].maxy) { cout << i + 1 << endl; flag = 0; break; } } if (flag) cout << "-1" << endl; return 0; }
0.0分
0 人评分
汽水瓶 (C语言代码)浏览:664 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:773 |
C语言训练-斐波纳契数列 (C语言代码)浏览:1271 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1015 |
WU-printf基础练习2 (C++代码)浏览:2061 |
单词个数统计 (C语言代码)浏览:1046 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:532 |
C语言程序设计教程(第三版)课后习题8.6 (C语言代码)浏览:856 |
字符串的修改 (C语言代码)浏览:1206 |
C语言训练-百钱百鸡问题 (C语言代码)浏览:541 |