50分代码,这题属实没看懂,极端情况如果a, b, k ,g都等于le5,不应该开[200000][200000]的数组才能保证不RE吗( x, y 也没有取值范围)?但开打了MLE开小了RE,请各位大佬帮助!!!
#include<bits/stdc++.h>
using namespace std;
int m[10000][10000] = {0};
int a[10000];
int b[10000];
int g[10000];
int k[10000];
int main()
{
int n;
cin >> n;
for(int i = 1;i <= n;i++)
{
cin >> a[i] >> b[i] >> g[i] >> k[i];
}
int x, y;
cin >> x >> y;
for(int i = 1;i <= n;i++)
{
for(int j = a[i];j <= a[i] + g[i];j++)
{
for(int p = b[i];p <= b[i] + k[i];p++)
{
m[j][p] = i;
}
}
}
if(m[x][y] == 0)
{
cout << -1 << endl;
}
else
{
cout << m[x][y] << endl;
}
return 0;
}