Submission #1053652

#TimeUsernameProblemLanguageResultExecution timeMemory
1053652phongSecret (JOI14_secret)C++17
0 / 100
277 ms4436 KiB
//#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]); }
#Verdict Execution timeMemoryGrader output
Fetching results...