Submission #1263927

#TimeUsernameProblemLanguageResultExecution timeMemory
1263927tminh비밀 (JOI14_secret)C++20
Compilation error
0 ms0 KiB
#include "secret.h"
#include "bits/stdc++.h"
using namespace std;

#define task ""
#define ll long long
#define endl '\n'
#define fi first
#define se second
#define vall(a) (a).begin(), (a).end()
#define sze(a) (int)a.size()
#define pii pair<int, int>
#define pll pair<ll, ll>


#define ep emplace_back
#define pb push_back
#define pf push_front


const ll mod = 1e9 + 7;
const int N = 1005 + 5;
const ll oo = 1e18;

bool START;

ll cur[N][10], a[N], n, bit[N];
void dnc(int l, int r, int depth) {
	if (l == r) return;
	int mid = (l + r) >> 1;
	cur[mid][depth] = a[mid];
	for (int i = mid - 1; i >= l; --i) cur[i][depth] = Secret(cur[i + 1][depth], a[i]);
	
	cur[mid + 1][depth] = a[mid + 1];
	for (int i = mid + 2; i <= r; ++i) cur[i][depth] = Secret(cur[i - 1][depth], a[i]); 
	for (int i = mid + 1; i <= r; ++i) bit[i] |= (1 << depth);
	
	dnc(l, mid + 1, depth + 1);
	dnc(mid + 1, r, depth + 1);
}
void Init(int N, int A[]) {
	n = N;
	for (int i = 1; i <= n; ++i) a[i] = A[i - 1];
	dnc(1, n, 0);
}

ll Query(int L, int R) {
	++L; ++R;
	int depth = __builtin_ctz(bit[L] ^ bit[R]);
	ll ans = Secret(cur[L][depth], cur[R][depth]); 
	return ans;
}

Compilation message (stderr)

secret.cpp:47:4: error: ambiguating new declaration of 'long long int Query(int, int)'
   47 | ll Query(int L, int R) {
      |    ^~~~~
In file included from secret.cpp:1:
secret.h:5:5: note: old declaration 'int Query(int, int)'
    5 | int Query(int L, int R);
      |     ^~~~~