# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
366397 | Kazalika | Cake 3 (JOI19_cake3) | C++14 | 2625 ms | 35932 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;
const int N = 2e5 + 5;
ll cval[N];
struct segment_tree {
int size;
vector<ll> sum, cnt;
segment_tree() {}
segment_tree(int sz) {
size = sz;
sum.resize(4 * size);
cnt.resize(4 * size);
}
void upd(int t, int l, int r, int id, ll add) {
if (l + 1 == r) {
cnt[t] += add;
sum[t] += add * cval[id];
return;
}
int md = r + l >> 1;
if (md > id)
upd(t * 2 + 1, l, md, id, add);
else
upd(t * 2 + 2, md, r, id, add);
sum[t] = sum[t * 2 + 1] + sum[t * 2 + 2];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |