# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
543328 | amunduzbaev | Land of the Rainbow Gold (APIO17_rainbow) | C++17 | 1618 ms | 233764 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 "rainbow.h"
#include "bits/stdc++.h"
using namespace std;
#ifndef EVAL
#include "grader.cpp"
#endif
#define ar array
const int N = 2e5 + 5;
struct MSST{
vector<int> tree[N << 2];
void add(int i, int y, int lx = 0, int rx = N, int x = 1){
tree[x].push_back(y);
if(lx == rx) return;
int m = (lx + rx) >> 1;
if(i <= m) add(i, y, lx, m, x<<1);
else add(i, y, m+1, rx, x<<1|1);
}
void build(int lx = 0, int rx = N, int x = 1){
tree[x].push_back(-1);
tree[x].push_back(N);
sort(tree[x].begin(), tree[x].end());
if(lx == rx) return;
int m = (lx + rx) >> 1;
build(lx, m, x<<1), build(m+1, rx, x<<1|1);
}
int get(int l, int r, int l_, int r_, int lx = 0, int rx = N, int x = 1){
# | 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... |