#include <bits/stdc++.h>
#include <secret.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#define ll long long
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
int sps[15][1005];
int l2(int p){
return 31-__builtin_clz(p);
}
void sp(int n,int a[]){
int k=l2(n);
for(int i=0;i<n;++i){
sps[0][i]=a[i];
}
for(int i=1;i<=k;++i){
for(int j=0;j+(1<<i)<=n;++j){
sps[i][j]=Secret(sps[i-1][j],sps[i-1][j+(1<<(i-1))]);
}
}
}
void Init(int N,int a[]){
sp(N,a);
}
int Query(int L,int R){
int i = l2(R-L+1);
int minimum = Secret(sps[i][L], sps[i][R - (1 << i) + 1]);
return minimum;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
83 ms |
2608 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 839935006. |
2 |
Incorrect |
79 ms |
2388 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 73044041. |
3 |
Incorrect |
86 ms |
2484 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 951413062. |
4 |
Incorrect |
298 ms |
4524 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 889372840. |
5 |
Incorrect |
301 ms |
4320 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 389074008. |
6 |
Incorrect |
292 ms |
4308 KB |
Wrong Answer: Query(915, 915) - expected : 282904741, actual : 31281100. |
7 |
Incorrect |
299 ms |
4380 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 709920818. |
8 |
Incorrect |
308 ms |
4436 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 225603928. |
9 |
Incorrect |
291 ms |
4436 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 819205962. |
10 |
Incorrect |
309 ms |
4456 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 538241930. |