//#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){
++L, ++R;
int k = __lg(R - L + 1);
return Secret(rmq[L][k], rmq[R - (1 <<k) + 1][k]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
65 ms |
2744 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 839935006. |
2 |
Incorrect |
68 ms |
2652 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 73044041. |
3 |
Incorrect |
66 ms |
2748 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 951413062. |
4 |
Incorrect |
253 ms |
4432 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 889372840. |
5 |
Incorrect |
252 ms |
4280 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 389074008. |
6 |
Incorrect |
277 ms |
4436 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 31281100. |
7 |
Incorrect |
253 ms |
4436 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 709920818. |
8 |
Incorrect |
254 ms |
4432 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 225603928. |
9 |
Incorrect |
253 ms |
4268 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 819205962. |
10 |
Incorrect |
257 ms |
4436 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 538241930. |