# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
75344 | FiloSanza | Deda (COCI17_deda) | C++14 | 594 ms | 3700 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;
struct segmentTree{
const int nullval = 2e9;
int S;
vector<int> v;
segmentTree(int s){
S = (1<<((int)ceil(log2(s))+1)) - 1;
v.resize(S, nullval);
}
inline int father(int pos){ return (pos-1)/2; }
inline int left(int pos){ return (pos*2)+1; }
inline int right(int pos){ return (pos+1)*2; }
void update(int pos, int val){
pos = pos + S/2;
assert(v[pos] == nullval);
v[pos] = val;
while(pos != 0){
pos = father(pos);
v[pos] = min(v[left(pos)], v[right(pos)]);
}
}
int solve(int pos, int val){
while(pos < S/2){
if(v[left(pos)] <= val)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |