Submission #263092

# Submission time Handle Problem Language Result Execution time Memory
263092 2020-08-13T13:00:15 Z ElyesChaabouni Pyramid Base (IOI08_pyramid_base) C++14
Compilation error
0 ms 0 KB
/*#pragma GCC optimize("O3")*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp> 
//#define ordered_set tree<int, null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
#define eps 1e-9
#define MOD1 998244353
#define MOD2 1000000007
#define INV_10 299473306
#define INF 1000000000
#define PI 3.14159265358979323846
using namespace std;
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n, m, b, p;
	cin >> m >> n >> b >> p;
	int r[n+1][m+1], d[n+1][m+1], dp[n+1][m+1];
	for(int i = 0; i <= n; i++)
	{
		for(int j = 0; j <= m; j++)
		{
				dp[i][j]=0;
				d[i][j]=1;
				r[i][j]=1;
		}
	}
	for(int i = 0; i < p; i++)
	{
		int x1, x2, y1, y2, pr;
		cin >> y1 >> x1 >> y2 >> x2 >> pr;
		for(int x = x1; x <= x2; x++)
		{
			for(int y = y1; y <= y2; y++)
			{
				r[x][y]=0;
				d[x][y]=0;
			}
		}
	}
	for(int i = 0; i <= m; i++)
		for(int j = n-1; j >= 0; j--)
			if(l[j][i])
				l[j][i]+=l[j+1][i];
	for(int i = 0; i <= n; i++)
		for(int j = m-1; j >= 0; j--)
			if(d[i][j])
				d[i][j]+=d[i][j+1];
	int ans=0;
	for(int i = m; i >= 0; i--)
	{
		for(int j = n; j >= 0; j--)
		{
			if(l[j][i] || d[j][i])
			{
				int dp[j][i]=min(d[j][i], l[j][i]);
				if(i+1 <= n && j+1 <= n)
				{
					dp[j][i]=min(ma, dp[j+1][i+1]+1);
					ans=max(ans, dp[j][i]);
				}
			}
		}
	}
	cout << ans << '\n';
}
//size

Compilation message

pyramid_base.cpp: In function 'int main()':
pyramid_base.cpp:43:7: error: 'l' was not declared in this scope
   43 |    if(l[j][i])
      |       ^
pyramid_base.cpp:54:7: error: 'l' was not declared in this scope
   54 |    if(l[j][i] || d[j][i])
      |       ^
pyramid_base.cpp:59:19: error: 'ma' was not declared in this scope; did you mean 'm'?
   59 |      dp[j][i]=min(ma, dp[j+1][i+1]+1);
      |                   ^~
      |                   m