# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
476341 | palilo | Art Exhibition (JOI18_art) | C++17 | 1 ms | 204 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;
template <class T>
bool chmin(T& _old, T _new) { return _old > _new && (_old = _new, true); }
template <class T>
bool chmax(T& _old, T _new) { return _old < _new && (_old = _new, true); }
constexpr int64_t INF = 0x3f3f3f3f3f3f3f3f;
template <typename T>
class binary_indexed_tree {
const size_t n;
vector<T> tree;
public:
binary_indexed_tree(size_t n) : n(n), tree(n + 1, ~INF) {}
void update(size_t i, T val) {
for (++i; i <= n; i += i & -i)
chmax(tree[i], val);
}
T query(size_t i) const {
T ret = ~INF;
for (; i; i &= i - 1)
chmax(ret, tree[i]);
return ret;
}
};
# | 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... |