Submission #935442

# Submission time Handle Problem Language Result Execution time Memory
935442 2024-02-29T05:11:04 Z Baizho Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include "secret.h"
#ifndef SECRET_H_
#define SECRET_H_
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
  
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
 
// #pragma GCC optimize("Ofast,unroll-loops,fast-math")
// #pragma GCC target("popcnt")
 
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pll;
 
#define sz size()
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define pb push_back
 
const int mod = ll(1e9)+7;
const ll MOD = 998244353;
const long long inf = 5e18;
const int M = 1005;

int Secret(int x, int y);

int val[10][M];

void Init(int n, int a[]) {
	for(int i = 0; i < n; i ++) val[0][i] = a[i];
	for(int j = 1; j <= 9; j ++) {
		for(int i = 0; i + (1 << j) - 1 < n; i ++) {
			val[j][i] = Secret(val[j - 1][i], val[j - 1][i + (1 << j - 1)]);
		}
	}
}

int Query(int l, int r) {
	int siz = r - l + 1, res = -1;
	for(int j = 9; l <= r && j >= 0; j --) {
		if(siz & (1 << j)) {
			if(res == -1) res = val[j][l];
			else res = Secret(res, val[j][l]);
			l += (1 << j);
		}
	}
	return res;
}


#endif  /* SECRET_H_ */

Compilation message

/usr/bin/ld: /tmp/ccLcs8Vi.o: in function `main':
grader-full.cpp:(.text.startup+0x2a8): undefined reference to `Init(int, int*)'
/usr/bin/ld: grader-full.cpp:(.text.startup+0x30b): undefined reference to `Query(int, int)'
collect2: error: ld returned 1 exit status