CODEVS 1134 noip2011 铺地毯

来源:互联网 发布:科比0506赛季数据 编辑:程序博客网 时间:2024/05/01 02:02
懒得用结构体
#include<cstdio>#include<cstdlib>#include<iostream>#include<algorithm>using namespace std;const int MAXN = 10000 + 10;int a[MAXN], b[MAXN], g[MAXN], k[MAXN];int main(){int n;int x, y;int ans = -1;cin >> n;for(int i = 1; i <= n; i++)cin >> a[i] >> b[i] >> g[i] >> k[i];cin >> x >> y;for(int i = 1; i <= n; i++){if(x >= a[i] && x <= a[i] + g[i] && y >= b[i] && y <= b[i] + k[i])ans = i;}cout << ans;return 0;}

0 0