# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1073359 | horiaboeriu | Addk (eJOI21_addk) | C++17 | 149 ms | 10576 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 <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#define MAXN 100000
#define MAXK 10
long long a[4 * MAXN], v1[4 * MAXN], sp[MAXN + 1];
int vnr[4 * MAXN];//cate numere sunt in acel nod
char flag[4 * MAXN];
int v[MAXN + 1], vpoz[MAXK];
long long sum;
void lazy(int nod) {
v1[2 * nod] += v1[nod];
v1[2 * nod + 1] += v1[nod];
a[2 * nod] += v1[nod] * vnr[2 * nod];
a[2 * nod + 1] += v1[nod] * vnr[2 * nod + 1];
flag[2 * nod] = flag[2 * nod + 1] = 1;
flag[nod] = v1[nod] = 0;
}
void build(int nod, int st, int dr) {
int mid;
if (st == dr) {
a[nod] = sp[st];
vnr[nod] = 1;
} else {
mid = (st + dr) / 2;
build(2 * nod, st, mid);
build(2 * nod + 1, mid + 1, dr);
a[nod] = a[2 * nod] + a[2 * nod + 1];
vnr[nod] = vnr[2 * nod] + vnr[2 * nod + 1];
}
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... |