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 "weirdtree.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 300010;
int n, h[maxn];
void initialise(int _n, int, int *_h) {
n = _n, copy(_h + 1, _h + n + 1, h + 1);
}
void cut(int l, int r, int k) {
while (k--) {
int i = max_element(h + l, h + r + 1) - h;
if (!h[i]) break;
h[i]--;
}
}
void magic(int i, int x) {
h[i] = x;
}
ll inspect(int l, int r) {
return accumulate(h + l, h + r + 1, 0LL);
}
# | 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... |