按输入的顺序
by coldskin233 @ 2018-03-14 18:00:45
"后铺的地毯覆盖在前面已经铺好的地毯之上。"
by Hono @ 2018-03-14 19:01:33
最后输入的那一块在最上面
by FCBM71 @ 2018-03-14 19:01:37
# 每次铺就吧前面的数据覆盖掉。弄一个二维数组嘛。
by 张皓涵 @ 2018-03-14 19:38:17
@[张皓涵](/space/show?uid=82630)
尽可能不用二维数组,有可能会爆
by 飞天者 @ 2018-03-17 19:40:09
@[haoyuan6118](/space/show?uid=13285)
10000×10000为什么爆?
by howtolearn @ 2018-03-24 22:06:37
我只是说有可能,用不好会爆,不一定的,主要看你用的方法。
by 飞天者 @ 2018-03-31 15:36:27
```c
#include <stdio.h>
#include <string.h>
#define MAXSIZE 10005
int main(void) {
int n;
int a[MAXSIZE], b[MAXSIZE], g[MAXSIZE], k[MAXSIZE];
int x, y;
memset(a, 0, MAXSIZE);
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
scanf("%d %d %d %d", &a[i], &b[i], &g[i], &k[i]);
}
scanf("%d %d", &x, &y);
for (int j = n - 1; j >= 0; --j) {
if ( a[j] <= x && x <= a[j] + g[j] && b[j] <= y && y <= b[j] + k[j] ) {
printf("%d\n", j+1);
return 0;
}
}
printf("%d\n", -1);
return 0;
}
```
by ultravires @ 2018-04-15 17:28:21