# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
65528 | naderjemel | Cake (CEOI14_cake) | C++14 | 1359 ms | 10656 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 long long ll;
int n,st;
int val,idx,maxi;
bool done;
int ns[250000];
int pos[250000];
vector<int> seg;
void init(){
int s=1;
for(;s<n;s<<=1); s<<=1;
seg.assign(s,0);
}
int query(int p, int lo ,int hi, int l, int r){
if(lo>=l && hi<=r) return seg[p];
if(hi<l || lo>r) return 0;
int mid=(lo+hi)/2;
int x=query(p*2,lo,mid,l,r);
int y=query(p*2+1,mid+1,hi,l,r);
return max(x,y);
}
void build(int p, int lo, int hi){
if(lo==hi){
seg[p]=(ll)ns[lo];
pos[lo]=p;
return;
}
int mid=(lo+hi)/2;
build(p*2,lo,mid);
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... |