# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
729559 | hoainiem | Rice Hub (IOI11_ricehub) | C++14 | 44 ms | 4236 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>
#include "ricehub.h"
#define lc id<<1
#define rc id<<1^1
#define nmax 100008
using namespace std;
int n, mx, ans = 0, a[nmax];
long long k;
struct segtree{
long long seg[nmax << 2];
void build(int id = 1, int l = 1, int r = n){
if (l == r){
seg[id] = a[l];
return;
}
int mid = (l + r) >> 1;
build(lc, l, mid);
build(rc, mid + 1, r);
seg[id] = seg[lc] + seg[rc];
}
long long get(int u, int v, int id = 1, int l = 1, int r = n){
if (r < u || l > v)
return 0;
if (u <= l && r <= v)
return seg[id];
int mid = (l + r) >> 1;
return get(u, v, lc, l, mid) + get(u, v, rc, mid + 1, r);
}
}tree;
long long cost(int l, int r){
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |