# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975543 | falaz | Fortune Telling 2 (JOI14_fortune_telling2) | C++17 | 301 ms | 113852 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 int long long
//#define endl '\n'
#define F first
#define S second
#define SZ(a) int32_t(a.size())
namespace RMQ {
const int N = 6e5 + 7, LG = 20;
int rmq[LG][N];
void add(int i, int k) {
rmq[0][i] = k;
return;
}
void pre(int n) {
for (int i = 0; i < LG - 1; ++i)
for (int j = 0; j + (2 << i) <= n; ++j)
rmq[i + 1][j] = max(rmq[i][j], rmq[i][j + (1 << i)]);
return;
}
int get(int l, int r) {
int L = __lg(r - l);
return max(rmq[L][l], rmq[L][r - (1 << L)]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |