Submission #243226

# Submission time Handle Problem Language Result Execution time Memory
243226 2020-06-30T15:13:54 Z Rainbowbunny Secret (JOI14_secret) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using cd = complex <double>;
 
typedef pair <int, int> pii;
 
const int Inf = 100000;
const int mod = 998244353;
const double Pi = acos(-1);
 
void Fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int n;
int a[1005];
int Table[1005][1005];

void Create(int l, int r)
{
	if(r - l == 1)
	{
		return;
	}	
	int mid = (l + r) >> 1;
	for(int i = mid - 1; i >= l; i--)
	{
		Table[i][mid] = Secret(Table[i + 1][mid], a[i]);
	}
	for(int i = mid + 2; i <= r; i++)
	{
		Table[i][mid] = Secret(Table[i - 1][mid], a[i]);
	}
	Create(l, mid);
	Create(mid + 1, r);
}

void Init(int N, int b[])
{
	n = N;
	for(int i = 0; i < n; i++)
	{
		a[i] = b[i];
		for(int j = 0; j < n; j++)
		{
			Table[i][j] = 1e9 + 5;
		}
		Table[i][i] = a[i];
	}
	Create(0, n);
}



int Query(int l, int r)
{
	if(r == l)
	{
		return a[r];
	}
	else if(r - l == 1)
	{
		return Secret(a[l], a[l + 1]);
	}
	else
	{
		if(Table[l][r] != 1000000005)
		{
			return Table[l][r];
		}
		for(int i = l; i <= r; i++)
		{
			if(Table[l][i] != 1000000005 and Table[i + 1][r] != 1000000005)
			{
				return Secret(Table[l][i], Table[i + 1][r]);
			}
		}
	}
}

Compilation message

secret.cpp: In function 'void Create(int, int)':
secret.cpp:35:19: error: 'Secret' was not declared in this scope
   Table[i][mid] = Secret(Table[i + 1][mid], a[i]);
                   ^~~~~~
secret.cpp:35:19: note: suggested alternative: 'qecvt'
   Table[i][mid] = Secret(Table[i + 1][mid], a[i]);
                   ^~~~~~
                   qecvt
secret.cpp:39:19: error: 'Secret' was not declared in this scope
   Table[i][mid] = Secret(Table[i - 1][mid], a[i]);
                   ^~~~~~
secret.cpp:39:19: note: suggested alternative: 'qecvt'
   Table[i][mid] = Secret(Table[i - 1][mid], a[i]);
                   ^~~~~~
                   qecvt
secret.cpp: In function 'int Query(int, int)':
secret.cpp:70:10: error: 'Secret' was not declared in this scope
   return Secret(a[l], a[l + 1]);
          ^~~~~~
secret.cpp:70:10: note: suggested alternative: 'qecvt'
   return Secret(a[l], a[l + 1]);
          ^~~~~~
          qecvt
secret.cpp:82:12: error: 'Secret' was not declared in this scope
     return Secret(Table[l][i], Table[i + 1][r]);
            ^~~~~~
secret.cpp:82:12: note: suggested alternative: 'qecvt'
     return Secret(Table[l][i], Table[i + 1][r]);
            ^~~~~~
            qecvt