| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1310464 | em4ma2 | Secret (JOI14_secret) | C++20 | 0 ms | 0 KiB |
#include "bits/stdc++.h"
#include "secret.h"
using namespace std;
#define int long long
#define ll long long
#define pb push_back
const int mxsz=1000;
int dst[11][mxsz];
int Query(int l,int r){
int x=__builtin_clz(max(l,r))-(l^r);
return Secret(dst[l][x],dst[r][x]);
}
void Init(int n,int a[]){
int cnt=2;
for (int i=0;i<11;i++){
int k=i+1;
while (k--){
int mx=n/cnt;
int cnt2=0;
bool b=0;
if (!b){
for (int j=cnt2+mx;j>=0;j--){
cnt2++;
if (j==cnt2+mx){
dst[i][j]=a[j];
}
else dst[i][j]=Secret(dst[i][j-1],a[j]);
}
}else{
for (int j=cnt2;j<cnt2+mx;j++){
if (j==cnt2)dst[i][j]=a[j];
else dst[i][j]=Secret(dst[i][j-1],a[j]);
}
cnt2+=mx;
}
}
cnt+=2;
}
}
// signed main(){
// ios::sync_with_stdio(0);
// cin.tie(0);
// cout.tie(0);
// int n;
// cin>>n;
// int a[n];
// for (int i=0;i<n;i++){
// cin>>a[i];
// }
// return 0;
// }
