#include "stations.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define SZ(a) ((int)a.size())
vector<int> idx;
vector<int> label(int n, int k, vector<int> u, vector<int> v)
{
idx.resize(n);
for(int i=0;i<n;++i)
idx[i]=i;
return idx;
}
int dis(int s,int t)
{
int ans=0;
while(s!=t)
if(s>t)
s>>=1,++ans;
else
t>>=1,++ans;
return ans;
}
int find_next_station(int s, int t, vector<int> c)
{
int midis=1e9,mi=-1;
for(int i:c)
if(dis(i,t)<midis)
midis=dis(i,t),mi=i;
return mi;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
549 ms |
876 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
503 ms |
864 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
546 ms |
864 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
890 ms |
644 KB |
Output is correct |
2 |
Correct |
675 ms |
640 KB |
Output is correct |
3 |
Incorrect |
592 ms |
648 KB |
Wrong query response. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
519 ms |
872 KB |
Wrong query response. |
2 |
Halted |
0 ms |
0 KB |
- |