//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include "secret.h"
#define ll long long
const int nmax = 1000 + 5;
const int lg = 17;
using namespace std;
int n, a[nmax];
int rmq[nmax][lg + 1];
void Init(int N, int A[]){
n = N;
for(int i = 1; i <= n; ++i) rmq[i][0] = A[i - 1];
for(int j = 1; j <= lg; ++j){
for(int i = 1; i + (1 << j) - 1 <= N; ++i){
rmq[i][j] = Secret(rmq[i][j - 1], rmq[i + (1 << (j - 1))][j - 1]);
}
}
}
int Query(int L, int R){
int k = __lg(R - L + 1);
return Secret(rmq[L][k], rmq[R - (1 <<k) + 1][k]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
66 ms |
2732 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 827672596. |
2 |
Incorrect |
66 ms |
2732 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 360392744. |
3 |
Incorrect |
67 ms |
2652 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 25270606. |
4 |
Incorrect |
253 ms |
4432 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 300106293. |
5 |
Incorrect |
257 ms |
4436 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 388503642. |
6 |
Incorrect |
254 ms |
4424 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 185445763. |
7 |
Incorrect |
251 ms |
4432 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 118685795. |
8 |
Incorrect |
256 ms |
4432 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 79889424. |
9 |
Incorrect |
252 ms |
4268 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 4732366. |
10 |
Incorrect |
253 ms |
4244 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 7086477. |