# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
681735 | NK_ | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 262 ms | 63764 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;
#define nl '\n'
using ll = long long;
struct BIT {
vector<int> data; int N;
void init(int n) { N = n; data = vector<int>(N, 0); }
void add(int p, int x) { for(++p;p<=N;p+=p&-p) data[p-1] += x; }
int sum(int l, int r) { return sum(r+1) - sum(l); }
int sum(int r) { int s = 0; for(;r;r-=r&-r) s += data[r-1]; return s; }
};
struct ST {
int level(int x) { return 31 - __builtin_clz(x); }
int comb(int a, int b) { return max(a, b); }
vector<int> v; vector<vector<int>> jmp;
void init(const vector<int> &_v) {
v = _v; jmp = {v};
for(int j = 1; (1<<j) <= int(size(v)); j++) {
jmp.push_back(vector<int>(int(size(v)) - (1<<j) + 1));
for(int i = 0; i < int(size(jmp[j])); i++) {
jmp[j][i] = comb(jmp[j-1][i], jmp[j-1][i + (1<<(j-1))]);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |