# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1057112 | manhlinh1501 | Secret (JOI14_secret) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const i64 MOD = 1e9 + 7;
const int MAXN = 1e3 + 5;
int N;
int a[MAXN];
i64 sum[MAXN][MAXN];
void Init(int N, int A[]) {
for(int i = 1; i <= N; i++) {
sum[i][i] = a[i];
for(int j = i + 1; j <= N; j++) {
sum[i][j] = Secret(sum[i][j - 1], a[j]);
}
}
}
i64 Query(int L, int R) {
return sum[L][R];
}