# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
626267 | Eae02 | Catfish Farm (IOI22_fish) | C++17 | 742 ms | 76392 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 "fish.h"
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define all(x) begin(x),end(x)
struct SegTree {
using T = ll; // use pair of value and index to get index from queries
T f(T a, T b) { return max(a, b); }
static constexpr T UNIT = 0; // neutral value for f
vector<T> s; ll n;
SegTree(ll len) : s(2 * len, UNIT), n(len) {}
void set(ll pos, T val) {
for (s[pos += n] = val; pos /= 2;)
s[pos] = f(s[pos * 2], s[pos * 2 + 1]);
}
T query(ll lo, ll hi) { // query lo to hi (hi not included)
if (lo >= hi) return UNIT;
T ra = UNIT, rb = UNIT;
for (lo += n, hi += n; lo < hi; lo /= 2, hi /= 2) {
if (lo % 2) ra = f(ra, s[lo++]);
if (hi % 2) rb = f(s[--hi], rb);
}
return f(ra, rb);
}
};
vector<vector<pair<ll, ll>>> fishWeightSum;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |