# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
132498 | tlwpdus | Cat in a tree (BOI17_catinatree) | C++11 | 139 ms | 19140 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;
const int INF = 0x3f3f3f3f;
int n, d;
vector<int> lis[200100];
int st[200100], en[200100], par[200100], dep[200100];
int tree[530000];
const int key = 262144;
void init() {
for (int i=0;i<key*2;i++) tree[i] = INF;
}
void upd(int s, int e, int val) {
s += key; e += key;
while(s<=e) {
if (s&1) tree[s] = min(tree[s],val);
if (~e&1)tree[e] = min(tree[e],val);
s = (s+1)/2;
e = (e-1)/2;
}
}
int getv(int idx) {
int ans = INF;
idx+=key;
while(idx) {
ans = min(ans,tree[idx]);
idx/=2;
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... |