# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
946288 | JooDdae | The Potion of Great Power (CEOI20_potion) | C++17 | 3040 ms | 99120 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;
using ll = long long;
#define mid ((l+r) >> 1)
struct Node {
int l, r, s;
} pt[20010010];
int pc;
int n, D, h[100100], r[100100];
array<int, 2> p[100100];
vector<pair<int, int>> d[100100];
int update(int u, int id, int val, int l = 0, int r = n-1) {
if(id < l || r < id) return u;
int x = ++pc;
pt[x] = pt[u], pt[x].s += val;
if(l == r) return x;
pt[x].l = update(pt[x].l, id, val, l, mid);
pt[x].r = update(pt[x].r, id, val, mid+1, r);
return x;
}
int find(int u, int id, int l = 0, int r = n-1) {
if(id < l || r < id) return 0;
if(l == r) return pt[u].s;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |