蒟蒻求助!MLE了五个点
查看原帖
蒟蒻求助!MLE了五个点
728645
clc123321楼主2023/10/17 15:05
#include <bits/stdc++.h>
using namespace std;
int n,g[10001][10001],a,b,x,y;
void fun(int q,int a,int b,int x,int y)
{
	g[a][b]=q;
	for(int m=1;m<=x;m++)
	for(int l=1;l<=y;l++)
	g[m][l]=q;
}
int main()
{
    ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
//  freopen(".in","r",stdin);
//  freopen(".out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++) 
	{
		cin>>a>>b>>x>>y;
		fun(i,a,b,x,y);
	}
	cin>>x>>y;
	if(g[x][y]!=0) cout<<g[x][y]<<endl;
	else cout<<"-1"<<endl;
	return 0;
}
2023/10/17 15:05
加载中...