# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300716 | hexan | Sterilizing Spray (JOI15_sterilizing) | C++14 | 357 ms | 7036 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 ll;
typedef long double ld;
#define all(x) (x).begin(), (x).end()
#define size(x) (ll)x.size()
#define chkmax(x, y) x = max(x, y)
#define chkmin(x, y) x = min(x, y)
const int N = (1 << 17);
ll t[2 * N], mx[2 * N];
int n, q, k;
void upd(int v, int tl, int tr, int l, int r) {
if (k == 1) return;
if (l >= r) return;
if (!mx[v]) return;
if (tl + 1 == tr) {
t[v] /= k;
mx[v] /= k;
return;
}
int tm = (tl + tr) / 2;
upd(v * 2 + 1, tl, tm, l, min(r, tm));
upd(v * 2 + 2, tm, tr, max(l, tm), r);
t[v] = t[v * 2 + 1] + t[v * 2 + 2];
mx[v] = max(mx[v * 2 + 1], mx[v * 2 + 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... |