# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
503991 | Abrar_Al_Samit | Secret (JOI14_secret) | C++17 | 522 ms | 4328 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 "secret.h"
#include <iostream>
using namespace std;
int sp[1000][11];
void Init(int N, int A[]) {
for(int i=0; i<N; ++i) {
sp[i][0] = A[i];
}
for(int j=1; j<11; ++j) {
for(int i=0; i+(1<<j)-1<N; ++i) {
sp[i][j] = Secret(sp[i][j-1], sp[i+(1<<(j-1))][j-1]);
}
}
}
int Query(int L, int R) {
int len = R-L+1;
int id = L;
int ret = 0;
for(int j=0; j<11; ++j) if(len>>j&1) {
ret = Secret(ret, sp[id][j]);
id += 1<<j;
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |