#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 |
1 |
Incorrect |
645 ms |
736 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
521 ms |
756 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
538 ms |
848 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
997 ms |
868 KB |
Output is correct |
2 |
Incorrect |
662 ms |
756 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
528 ms |
736 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |