# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1053650 |
2024-08-11T15:01:13 Z |
phong |
Secret (JOI14_secret) |
C++17 |
|
0 ms |
0 KB |
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
//#pragma GCC optimize("unroll-loops")
//#include<bits/stdc++.h>
#include "secret.h"
#define ll long long
const int nmax = 1000 + 5;
const int lg = 17;
using namespace std;
int n, a[nmax];
int rmq[nmax][lg + 1];
void Init(int N, int A[]){
n = N;
for(int i = 1; i <= n; ++i) rmq[i][0] = A[i - 1];
for(int j = 1; j <= lg; ++j){
for(int i = 1; i + (1 << j) - 1 <= N; ++i){
rmq[i][j] = Secret(rmq[i][j - 1], rmq[i + (1 << (j - 1))][j - 1]);
}
}
}
int Query(int L, int R){
int k = __lg(R - L + 1);
return Secret(rmq[L][k], rmq[R - (1 <<k) + 1][k]);
}
Compilation message
secret.cpp: In function 'int Query(int, int)':
secret.cpp:24:13: error: '__lg' was not declared in this scope; did you mean 'lg'?
24 | int k = __lg(R - L + 1);
| ^~~~
| lg