# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
590327 | Soumya1 | Sky Walking (IOI19_walk) | C++17 | 4089 ms | 797232 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "walk.h"
#include <bits/stdc++.h>
#ifdef __LOCAL__
#include <debug_local.h>
#endif
using namespace std;
template<typename T, class F = function<T(const T&, const T&)>>
struct SparseTable {
vector<vector<T>> v;
F f;
SparseTable() { };
SparseTable(vector<T> a, F _f) : f(_f) {
int n = (int) a.size();
a.resize(n);
int lg = 32 - __builtin_clz(n);
v.resize(lg);
v[0] = a;
for (int j = 1; j < lg; j++) {
v[j].resize(n - (1 << j) + 1);
for (int i = 0; i <= n - (1 << j); i++) {
v[j][i] = f(v[j - 1][i], v[j - 1][i + (1 << (j - 1))]);
}
}
}
T query(int l, int r) {
int lg = 31 - __builtin_clz(r - l + 1);
return f(v[lg][l], v[lg][r - (1 << lg) + 1]);
}
};
const int mxN = 5e6 + 5;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |