# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
245122 | kimbj0709 | Railway (BOI17_railway) | C++14 | 104 ms | 25160 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;
#define maxn 100050
vector<vector<pair<int,int> > > adj(maxn);
vector<int> cnt(maxn,0);
vector<int> vect1;
vector<int> seg(maxn*20,0);
vector<int> depth(maxn,INT_MAX);
vector<int> pos(maxn);
int no_of_vertex,no_of_people,mini;
void build(int node,int start,int end){
if(start==end){
seg[node] = vect1[start];
return;
}
int mid = (start+end)/2;
build(node*2+1,start,mid);
build(node*2+2,mid+1,end);
if(depth[seg[node*2*2]]>depth[seg[node*2+1]]){
seg[node] = seg[node*2+1];
}
else{
seg[node] = seg[node*2+2];
}
}
int query(int node,int start,int end,int rangemin,int rangemax){
if(start>rangemax||end<rangemin){
return -1;
}
if(start>=rangemin&&end<=rangemax){
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... |