Submission #922532

# Submission time Handle Problem Language Result Execution time Memory
922532 2024-02-05T16:14:04 Z hqminhuwu Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define forr(_a,_b,_c) for(int _a = (_b); _a <= (_c); ++_a)
#define ford(_a,_b,_c) for(int _a = (_b) + 1; _a --> (_c);)
#define forf(_a,_b,_c) for(int _a = (_b); _a < (_c); ++_a)
#define st first
#define nd second
#define ll long long
#define ull unsigned long long
#define pii pair <int,int>
#define pll pair <ll,ll>
#define piii pair <int,pii>
#define vi vector <int>
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define file "test"


using namespace std;
const int N = 5e5 + 5;
const ll oo = 1e9;
const ll mod = 1e9 + 7;

int a[N], n, f[N][N];

void calc (int l, int r){
	if (r < l)
		return;
	int mid = (l + r) / 2;
	f[mid][mid] = a[mid];
	f[mid + 1][mid + 1] = a[mid + 1];

	ford (i, mid - 1, l)
		f[mid][i] = Secret(a[i], f[mid][i + 1]);

	forr (i, mid + 2, r)
		f[mid + 1][i] = Secret(a[i], f[mid + 1][i - 1]);
	
	calc (l, mid - 1);
	calc (mid + 1, r);
}

void Init (int u, int z[]){
	n = u;
	forf (i, 0, n)
		a[i] = z[i];
	calc (0, n - 1);
}

int query (int u, int v){
	int l = 0, r = n - 1;
	
	while (l < r){
		int mid = (l + r) / 2;
		if (mid >= u && mid < v) return Secret(f[mid][u], f[mid + 1][v]);
		if (mid == v) return f[mid][u];
		if (mid > u) r = mid - 1;
		else l = mid + 1;
	}

	return f[l][l];
}


/*



*/

Compilation message

secret.cpp: In function 'void calc(int, int)':
secret.cpp:34:15: error: 'Secret' was not declared in this scope
   34 |   f[mid][i] = Secret(a[i], f[mid][i + 1]);
      |               ^~~~~~
secret.cpp:37:19: error: 'Secret' was not declared in this scope
   37 |   f[mid + 1][i] = Secret(a[i], f[mid + 1][i - 1]);
      |                   ^~~~~~
secret.cpp: In function 'int query(int, int)':
secret.cpp:55:35: error: 'Secret' was not declared in this scope
   55 |   if (mid >= u && mid < v) return Secret(f[mid][u], f[mid + 1][v]);
      |                                   ^~~~~~