# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
691358 | tengiz05 | Railway Trip (JOI17_railway_trip) | C++17 | 877 ms | 64568 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;
struct Node {
int s = 0;
Node *l = nullptr;
Node *r = nullptr;
};
Node *add(Node *t, int l, int r, int x) {
Node *nt = new Node();
if (t != nullptr) {
*nt = *t;
}
nt->s++;
if (r - l > 1) {
int m = (l + r) / 2;
if (x < m) {
nt->l = add(nt->l, l, m, x);
} else {
nt->r = add(nt->r, m, r, x);
}
}
return nt;
}
int query(Node *t1, Node *t2, int l, int r, int x, int y) {
if (r <= x || y <= l) {
return 0;
}
if (x <= l && r <= y) {
# | 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... |