# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
342943 | Tosic | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 267 ms | 44908 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>
#define maxn 800010
using namespace std;
int n, m, a[maxn], allR[maxn], ans;
vector<int> sorted[maxn];
void init(int idx, int l, int r){
//cerr<< idx<< '\n';
if(l == r){
//segTree[idx].maxS = segTree[idx].minS = a[l];
//cerr<< 'a';
sorted[idx]={a[l]};
//cerr<<'b';
return;
}
int mid = (r+l)/2;
init(idx*2+1, l, mid);
init(idx*2+2, mid+1, r);
//cerr<< sorted[idx*2+1].size( ) << '\n';
//segTree[idx].maxS = max(segTree[idx*2+1].maxS, segTree[idx*2+2].maxS);
//segTree[idx].minS = min(segTree[idx*2+1].minS, segTree[idx*2+2].minS);
//segTree[idx].res = max(segTree[idx*2+1].res, segTree[idx*2+2].res);
//int n1 =sorted[idx*2+1].size(), m1 = sorted[idx*2+2].size();
//cerr<< sorted[idx*2+1].size() << '\n';
sorted[idx].resize(sorted[idx*2+1].size()+sorted[idx*2+2].size());
merge(sorted[idx*2+1].begin(), sorted[idx*2+1].end(), sorted[idx*2+2].begin(), sorted[idx*2+2].end(), sorted[idx].begin());
// for(int i = 0, j = 0; i < n1 and j < m1; i = min(i, n1-1), j =min(j, m1-1)){
// int a = sorted[idx*2+1][i], b = sorted[idx*2+2][j];
# | 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... |