# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
759241 | PurpleCrayon | Magic Tree (CEOI19_magictree) | C++17 | 614 ms | 161440 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;
#define sz(v) int(v.size())
#define ar array
const int N = 1e5+10, MOD = 1e9+7;
const ll INF = 1e18+10;
struct T {
T *l, *r;
ll sum;
T() {
l = r = nullptr;
sum = 0;
}
void upd(int tl, int tr, int pos, ll x) {
sum += x;
if (tl == tr) {
return;
}
int tm = (tl + tr) / 2;
if (pos <= tm) {
if (!l) l = new T();
l->upd(tl, tm, pos, x);
} else {
if (!r) r = new T();
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |