为什么会全Runtime Error?
查看原帖
为什么会全Runtime Error?
45128
Asiimov楼主2020/6/9 16:55

在VS里头编译过了的,数据也测试过了,不知道为什么提交进去就会RE。要是犯了什么弱智问题的话大佬轻喷

#include <iostream>
using namespace std;

int main()
{
	int n, request_X, request_Y;
	int startLocation_X, startLocation_Y, length_X, length_Y, endLocation_X, endLocation_Y;
	int plotMap[2 * 10 ^ 5][2 * 10 ^ 5]{};
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> startLocation_X >> startLocation_Y;
		cin >> length_X >> length_Y;
		endLocation_X = startLocation_X + length_X;
		endLocation_Y = startLocation_Y + length_Y;
		for (int x = startLocation_X; x <= endLocation_X; x++)
		{
			for (int y = startLocation_Y; y <= endLocation_Y; y++)
			{
				plotMap[x][y] = i + 1;
			}
		}
	}
	cin >> request_X >> request_Y;
	if (plotMap[request_X][request_Y] != 0)
	{
		cout << plotMap[request_X][request_Y] << endl;
	}
	else {
		cout << -1 << endl;
	}
	return 0;
}
2020/6/9 16:55
加载中...