# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397616 | MrRobot_28 | Index (COCI21_index) | C++17 | 2584 ms | 121220 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;
#define X first
#define Y second
#define sz(a) (int)a.size()
const int mod = 1e9 + 7;
const int N = 2e5;
vector <int> uk_left[N * 4];
vector <int> uk_right[N * 4];
vector <int> Tree[4 * N];
int h[N];
int n, q;
void build(int v, int l, int r)
{
if(l == r)
{
Tree[v].push_back(h[l]);
return;
}
build(v * 2, l, (r + l) / 2);
build(v * 2 + 1, (r + l) / 2 + 1, r);
int j = 0;
for(int i = 0; i < sz(Tree[v * 2]); i++)
{
while(j < sz(Tree[v * 2 + 1]) && Tree[v * 2 + 1][j] < Tree[v * 2][i])
{
Tree[v].push_back(Tree[v * 2 + 1][j]);
j++;
}
Tree[v].push_back(Tree[v * 2][i]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |