#include "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e3+9,lg = 12;
int n,cnt = 0;
int a[inf],Log2[inf],sparse[lg][inf];
vector<int> tmp;
void Init(int N, int A[]) {
n = N;
Log2[1] = 0;
for(int i=2;i<=n;i++)
Log2[i] = Log2[i/2] + 1;
for(int i=1;i<=n;i++)
a[i] = A[i-1],sparse[0][i] = a[i];
for(int j=1;j<lg;j++)
for(int i=1;i+(1<<j)-1<=n;i++)
sparse[j][i] = Secret( sparse[j-1][i],sparse[j-1][ i+(1<<(j-1)) ] ),cnt++;
assert(cnt<=8000);
}
int Query(int L, int R) {
L++,R++;
int len = R-L+1;
int k = Log2[len];
return Secret( sparse[L][k] , sparse[R-(1<<k)+1][k] );
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
145 ms |
4728 KB |
Execution killed with signal 11 |
2 |
Runtime error |
141 ms |
4728 KB |
Execution killed with signal 11 |
3 |
Runtime error |
143 ms |
4728 KB |
Execution killed with signal 11 |
4 |
Runtime error |
523 ms |
8780 KB |
Execution killed with signal 11 |
5 |
Runtime error |
518 ms |
8568 KB |
Execution killed with signal 11 |
6 |
Runtime error |
516 ms |
8572 KB |
Execution killed with signal 11 |
7 |
Runtime error |
524 ms |
8568 KB |
Execution killed with signal 11 |
8 |
Runtime error |
523 ms |
8568 KB |
Execution killed with signal 11 |
9 |
Runtime error |
516 ms |
8824 KB |
Execution killed with signal 11 |
10 |
Runtime error |
522 ms |
8640 KB |
Execution killed with signal 11 |