Submission #1131113

#TimeUsernameProblemLanguageResultExecution timeMemory
1131113khoavn2008Secret (JOI14_secret)C++20
0 / 100
416 ms4488 KiB
#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int LOG = 14;
int n, a[LOG + 1][10001];
void Init(int N, int A[]) {
    n = N;
    for(int i = 0; i < n; i++)a[0][i] = A[i];
    for(int j = 1; j <= LOG; j++)for(int i = 0; i < n - (1 << j) + 1; i++){
        a[j][i] = Secret(a[j - 1][i], a[j - 1][i + (1 << (j - 1))]);
    }
}
int Query(int L, int R) {
    int tmp = __lg(R - L + 1);
    return Secret(a[tmp][L], a[tmp][R - (1 << tmp) + 1]);
}
#Verdict Execution timeMemoryGrader output
Fetching results...