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 <vector>
#include <iostream>
#include <math.h>
using namespace std;
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
std::vector<int> labels(n);
for(int i=0;i<n;i++){
labels[i]=i+1;
}
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
if(t<s){
int minv=c[0];
for(auto it=c.begin();it!=c.end();it++){
minv=min(minv,*it);
}
return minv;
}
else{
while(floor(log2(t))!=floor(log2(s))){
t/=2;
}
if(t/2!=s)
{
int minv=c[0];
for(auto it=c.begin();it!=c.end();it++){
minv=min(minv,*it);
}
return minv;
}
else{
return t;
}
}
}
# | 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... |