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 "stations.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
vector <int> vec;
for(int i=0;i<n;i++) vec.push_back(i);
return vec;
}
int find_next_station(int s, int t, std::vector<int> c) {
if(c.size()==1) return c[0];
if(!s){
int l=c[0],r=c[1];
while(t>r) l=2*l+1,r=2*r+2;
if(t-l<r-t) return c[0];
return c[1];
}
if(c.size()==2){
if(t==c[1]) return c[1];
return c[0];
}
int l=c[0],r=c[1];
while(t>r) l=2*l+1,r=2*r+2;
if(t<l) return c[0];
if(t-l<r-t) return c[1];
return c[2];
}
# | 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... |