# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631223 | abeker | Radio Towers (IOI22_towers) | C++17 | 2315 ms | 229444 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 "towers.h"
using namespace std;
const int INF = 2e9;
struct Node {
int cnt;
Node *l, *r;
Node(int cnt, Node* l, Node* r) : cnt(cnt), l(l), r(r) {}
Node() : cnt(0), l(nullptr), r(nullptr) {}
};
class Persistent {
int offset;
vector <Node*> root;
Node* NIL;
public:
Node* update(Node* x, int lo, int hi, int pos) {
if (pos < lo || pos >= hi)
return x;
if (hi - lo == 1)
return new Node(x -> cnt + 1, NIL, NIL);
int mid = lo + (hi - lo) / 2;
Node* lft = update(x -> l, lo, mid, pos);
Node* rig = update(x -> r, mid, hi, pos);
return new Node(lft -> cnt + rig -> cnt, lft, rig);
}
Persistent(vector <int> vals) {
NIL = new Node();
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |