# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
112867 | Anai | Secret (JOI14_secret) | C++14 | 516 ms | 4696 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 "secret.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
vector<int> pom[N * 4];
int v[N];
int n, ql, qr;
static inline void build(int nod, int st, int dr) {
if (st == dr) {
pom[nod] = {v[st]};
return; }
int mid = (st + dr) / 2;
build(2 * nod, st, mid);
build(2 * nod + 1, mid + 1, dr);
pom[nod].resize(dr - st + 1);
pom[nod][mid - st] = v[mid];
pom[nod][mid + 1 - st] = v[mid + 1];
for (int i = mid + 2; i <= dr; ++i)
pom[nod][i - st] = Secret(pom[nod][i - 1 - st], v[i]);
for (int i = mid - 1; i >= st; --i)
pom[nod][i - st] = Secret(v[i], pom[nod][i + 1 - st]); }
static int query(int nod, int st, int dr) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |