# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
67893 | funcsr | Teams (IOI15_teams) | C++17 | 4038 ms | 86852 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 "teams.h"
#include <vector>
#include <cassert>
#include <algorithm>
#include <iostream>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(x) x.begin(), x.end()
#define uniq(x) x.erase(unique(all(x)), x.end())
#define index(x, y) (int)(lower_bound(all(x), y)-x.begin())
#define pb push_back
const int MAX_N = 5e5+5;
struct Node {
int val;
Node *left, *right;
Node() : val(0), left(NULL), right(NULL) {}
};
int query(Node *n, int a, int b, int l=0, int r=MAX_N) {
if (b <= l || r <= a) return 0;
if (a <= l && r <= b) return n->val;
int ret = 0;
if (n->left) ret += query(n->left, a, b, l, (l+r)/2);
if (n->right) ret += query(n->right, a, b, (l+r)/2, r);
return ret;
}
Node *add(Node *n, int x, int l=0, int r=MAX_N) {
if (r-l == 1) {
Node *ret = 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... |