# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
386989 | keko37 | Food Court (JOI21_foodcourt) | C++14 | 441 ms | 53948 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;
typedef long long llint;
typedef pair <llint, llint> pi;
const int MAXN = 250005;
int n, m, q, ofs = 1;
llint tip[MAXN], lef[MAXN], rig[MAXN], k[MAXN], col[MAXN], sol[MAXN];
pi t[MAXN * 4]; llint sum[MAXN * 4];
vector <pi> v[MAXN];
vector <int> u[MAXN];
pi spoji (pi a, pi b) {
return {a.first + b.first, max(a.second + b.first, b.second)};
}
void update (int pos, llint val) {
pos += ofs;
t[pos].first += val;
t[pos].second = max(t[pos].first, 0LL);
sum[pos] = t[pos].second;
pos /= 2;
while (pos > 0) {
t[pos] = spoji(t[pos * 2], t[pos * 2 + 1]);
sum[pos] = sum[2 * pos] + sum[2 * pos + 1];
pos /= 2;
}
# | 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... |