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 <queue>
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;
}
return labels;
}
int find_next_station(int s, int t, std::vector<int> c) {
queue<int> q;
q.push(c[1]);
while(!q.empty()){
int a = q.front();q.pop();
if(a == t)return c[1];
if(a > t)continue;
q.push({2*a+1});
q.push({2*a+2});
}
q.push(c[2]);
while(!q.empty()){
int a = q.front();q.pop();
if(a == t)return c[2];
if(a > t)continue;
q.push({2*a+1});
q.push({2*a+2});
}
return c[0];
}
# | 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... |