#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> 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) {
if(c.size()==1) return c[0];
set<int> st;
for(int i=0; i<c.size(); i++){
st.insert(c[i]);
}
int curr_s = s, curr_t = t;
//cout << curr_s << " " << curr_t << " balsal69" << endl;
if(curr_s > curr_t){
swap(curr_s, curr_t);
}
//cout << curr_s << " " << curr_t << " balsal" << endl;
//return 0;
while(true){
//cout << curr_s << " " << curr_t << endl;
int a = (curr_t - 1) / 2;
if(st.count(a)>0){
return a;
} else {
curr_t = a;
}
if(curr_s > curr_t){
swap(curr_s, curr_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... |