# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
286896 | bensonlzl | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 1793 ms | 67732 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;
typedef pair<int,int> pi;
typedef pair<pi,int> pii;
int N, M, L, R, K;
int W[1000005], hleft[1000005];
int ans[1000005];
vector<pii> quer[1000005];
int seg[4000005];
void update(int s, int e, int node, int x, int v){
if (s == e){
seg[node] = max(seg[node],v);
return;
}
if (x <= (s+e)/2) update(s,(s+e)/2,2*node,x,v);
else update((s+e)/2+1,e,2*node+1,x,v);
seg[node] = max(seg[2*node],seg[2*node+1]);
}
int query(int s, int e, int node, int l, int r){
if (l > e || r < s) return -1;
if (l <= s && e <= r) return seg[node];
return max(query(s,(s+e)/2,2*node,l,r),query((s+e)/2+1,e,2*node+1,l,r));
}
# | 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... |