# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166422 | GioChkhaidze | Hedgehog Daniyar and Algorithms (IZhO19_sortbooks) | C++14 | 2420 ms | 127432 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 Tree int h,int l,int r
#define Left (h<<1),l,((l+r)>>1)
#define Right ((h<<1)|1),((l+r)>>1)+1,r
using namespace std;
const int N=2e6+5;
bool ANS[N];
int n,q,idx,val,L,R;
int w[N],a[N],b[N],c[N],Greater[N],v[6*N];
stack < int > st;
vector < int > Query[N];
void Upd(Tree) {
if (idx<l || r<idx) return;
if (l==idx && r==idx) { v[h]=val; return; }
Upd(Left),Upd(Right);
if (v[(h<<1)]>v[((h<<1)|1)]) v[h]=v[(h<<1)];
else v[h]=v[((h<<1)|1)];
}
int Get(Tree) {
if (r<L || R<l) return 0;
if (L<=l && r<=R) return v[h];
int x=Get(Left),y=Get(Right);
if (x<y) return y;
return x;
}
main () {
scanf("%d%d",&n,&q);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |