# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
921341 | hotboy2703 | Constellation 3 (JOI20_constellation3) | C++14 | 568 ms | 109668 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define MASK(i) (1LL<<(i))
#define BIT(mask,i) (((mask) >> (i))&1LL)
const ll MAXN = 2e5;
const ll MAXK = 18;
ll n,m;
ll a[MAXN + 1];
namespace max_height{
ll sp[MAXK][MAXN+1];
ll best(ll x,ll y){
if (a[x]>a[y])return x;
return y;
}
void init(){
for (ll i = 1;i <= n; i++){
sp[0][i] = i;
}
for (ll j = 1;j < MAXK;j ++){
for (ll i = 1;i + MASK(j) - 1 <= n;i ++){
sp[j][i] = best(sp[j-1][i],sp[j-1][i+MASK(j-1)]);
}
}
}
ll query(ll l,ll r){
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |