# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387492 | ParsaAlizadeh | 팀들 (IOI15_teams) | C++17 | 1277 ms | 524292 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 "teams.h"
using namespace std;
typedef pair<int, int> pii;
struct Node : enable_shared_from_this<Node> {
int cnt;
shared_ptr<Node> lc, rc;
Node() : cnt(0) {}
void init() {
lc = shared_from_this();
rc = shared_from_this();
}
shared_ptr<Node> add(int l, int r, int ind) {
if (ind < l || r <= ind)
return shared_from_this();
shared_ptr<Node> cur = make_shared<Node>();
if (r - l == 1) {
cur->init();
cur->cnt = cnt + 1;
return cur;
}
int mid = (l + r) >> 1;
cur->lc = lc->add(l, mid, ind);
cur->rc = rc->add(mid, r, ind);
cur->cnt = cnt + 1;
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... |