# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
379161 | FatihSolak | Deda (COCI17_deda) | C++17 | 527 ms | 4580 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 N 200005
#define K 20
#define INF 1000000005
using namespace std;
int t[4*N];
void upd(int v,int l,int r,int pos,int val){
if(l == r){
t[v] = val;
return;
}
int m = (l+r)/2;
if(pos<=m){
upd(v*2,l,m,pos,val);
}
else{
upd(v*2+1,m+1,r,pos,val);
}
t[v] = min(t[v*2],t[v*2+1]);
}
int get(int v,int tl,int tr,int l,int r,int val){
if(tr < l || r < tl)return -1;
if(t[v] > val)return -1;
if(tl == tr)return tl;
int tm = (tl+tr)/2;
int tmp = get(v*2,tl,tm,l,r,val);
if(tmp != -1){
return tmp;
}
return get(v*2+1,tm+1,tr,l,r,val);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |