5AC, 5MLE, 咋整???
查看原帖
5AC, 5MLE, 咋整???
373959
AFwhcing楼主2021/7/15 15:40
#include <bits/stdc++.h>
using namespace std;

int n;
int a;
int b;
int g;
int k;
int x;
int y;
int f[10001][10001];
int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a >> b >> g >> k;
		for (int j = a; j <= a + g; ++j) {
			for (int l = b; l <= b + k; l++) {
				f[j][l] = i;
			}
		}
	}
	cin >> x >> y;
	if (!f[x][y]) {
		cout << -1 << endl;
	}
	cout << f[x][y] << endl;
	return 0;
}
2021/7/15 15:40
加载中...